FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

I can "debug" my project, but I can't run it....

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
misterdanny



Joined: 26 Jun 2009
Posts: 4

PostPosted: Thu Jul 23, 2009 3:31 am    Post subject: I can "debug" my project, but I can't run it.... Reply with quote

I am running windows, using netbeans 6.7. I just installed the netbeans c/c++ plugin according to this tutorial. http://www.netbeans.org/community/releases/67/cpp-setup-instructions.html

I installed mingw for my compiler. I followed the instructions letter for letter..

I am now trying to compile and run this code..

Code:

#include <iostream>

int main() {
    std::cout << "Test" << std::endl;
    char c;
    std::cin >> c;   
    return 0;
}


I am able to build the project, however whenever I press run, I get a command prompt screen that shows this:
Code:

C:/Users/Danny/AppData/Local/Temp/dlight8444146697431806377termexec.env: line 1:
 syntax error near unexpected token `('
C:/Users/Danny/AppData/Local/Temp/dlight8444146697431806377termexec.env: line 1:
 `PATH=/bin:/usr/bin::/C/Windows/system32:/C/Windows:/C/Windows/System32/Wbem:/C
/Windows/System32/WindowsPowerShell/v1.0/:/C/Program\ Files\ (x86)/ATI\ Technolo
gies/ATI.ACE/Core-Static:/C/Program\ Files\ (x86)/Common\ Files/Intuit/QBPOSSDKR
untime:/C/Program\ Files\ (x86)/php:/C/Program\ Files/MySQL/MySQL\ Server\ 5.1/b
in:/C/Program\ Files\ (x86)/Common\ Files/Adobe/AGL:/C/Program\ Files\ (x86)/Jav
a/jdk1.6.0_14/bin:/C/MinGW/bin: && export PATH'
Press [Enter] to close the terminal ...


the "run" console in netbeans reads
Code:

Process is started in an external terminal ...

RUN FAILED (exit value 1, total time: 54ms)




However, if I choose debug isntead of run, it seems to work...

the command prompt reads
Code:

Test


Code:

Launching
User program running
User program running
User program running
User program finished


I can't seem to figure out what is going on here...

(when I go to tools->options->c/c++, all of the fields are filled out correctly, except that it says fortan compiler is missing or invalid, which isn't the problem)
Back to top
View user's profile Send private message
Andrew Krasny
Posted via mailing list.





PostPosted: Thu Jul 23, 2009 9:26 am    Post subject: I can "debug" my project, but I can't run it.... Reply with quote

misterdanny,


this a known problem and it should be fixed in patch1. So the advice
would be to use current development version or wait for patch 1.

With your version, could you, please try run your project with "Output
Window" option (Properties->Run->Console Type).

Thanks,
=Andrew


23.07.09 07:32, misterdanny::
Quote:
I am running windows, using netbeans 6.7. I just installed netbeans. I just installed the c/c++ plugin according to this tutorial. http://www.netbeans.org/community/releases/67/cpp-setup-instructions.html



I installed mingw for my compiler. I followed the instructions letter for letter..



I am trying to compile and run this code..




Code:


#include <iostream>



int main() {

std::cout << "Test" << std::endl;

char c;

std::cin >> c;

return 0;

}







I am able to build the project, however whenever I press run, I get a command prompt screen that shows this:


Code:


C:/Users/Danny/AppData/Local/Temp/dlight8444146697431806377termexec.env: line 1:

syntax error near unexpected token `('

C:/Users/Danny/AppData/Local/Temp/dlight8444146697431806377termexec.env: line 1:

`PATH=/bin:/usr/bin::/C/Windows/system32:/C/Windows:/C/Windows/System32/Wbem:/C

/Windows/System32/WindowsPowerShell/v1.0/:/C/Program\ Files\ (x86)/ATI\ Technolo

gies/ATI.ACE/Core-Static:/C/Program\ Files\ (x86)/Common\ Files/Intuit/QBPOSSDKR

untime:/C/Program\ Files\ (x86)/php:/C/Program\ Files/MySQL/MySQL\ Server\ 5.1/b

in:/C/Program\ Files\ (x86)/Common\ Files/Adobe/AGL:/C/Program\ Files\ (x86)/Jav

a/jdk1.6.0_14/bin:/C/MinGW/bin: && export PATH'

Press [Enter] to close the terminal ...







the "run" console in netbeans reads


Code:


Process is started in an external terminal ...



RUN FAILED (exit value 1, total time: 54ms)











However, if I choose debug isntead of run, it seems to work...



the command prompt reads


Code:


Test








Code:


Launching

User program running

User program running

User program running

User program finished







I can't seem to figure out what is going on here...



(when I go to tools->options->c/c++, all of the fields are filled out correctly, except that it says fortan compiler is missing or invalid, which isn't the problem)









Back to top
misterdanny



Joined: 26 Jun 2009
Posts: 4

PostPosted: Thu Jul 23, 2009 4:39 pm    Post subject: Reply with quote

Ah that seems to have fixed the problem. thanks!
Back to top
View user's profile Send private message
nullimage



Joined: 31 Aug 2009
Posts: 1

PostPosted: Mon Aug 31, 2009 2:32 pm    Post subject: same problem Reply with quote

Hi, I'm having the exact same problem only i'm using version 6.7.1, I've tried changing the console to "output window" and this "sort of" works.

However, using the "output window" when I place an input instruction (scanf, etc) any previous outputted text won't show until after I enter a value, and then it spits out all the previous output...

For example, with this code:
Quote:
int main(int argc, char**argv) {
int i;
printf("Test program\n");
printf("Input a number:");
scanf("%i",&i);
printf("\nYour number was: %i",i);
return 0;
}


I get a blank window, and only after typing a value and pressing enter does the text appear:
Quote:
2
Test program
Input a number:
Your number was: 2
RUN SUCCESSFUL (total time: 2s)


Any help would be appreciated.
Back to top
View user's profile Send private message
josue.barroso



Joined: 23 Oct 2009
Posts: 3

PostPosted: Fri Oct 23, 2009 2:13 am    Post subject: Reply with quote

I'm having the same problem
Version 6.7.1 too
And I agree with nullimage
That fix is a problem when the program depends on the console for I/O

What we can do? When will it get fixed?
Back to top
View user's profile Send private message
Leonid Lenyashin
Posted via mailing list.





PostPosted: Fri Oct 23, 2009 7:30 am    Post subject: I can "debug" my project, but I can't run it.... Reply with quote

Try to go into project properties and turn off "Profile on Run" option.
It might help.

josue.barroso wrote:
Quote:
I'm having the same problem

Version 6.7.1 too

And I agree with nullimage

That fix is a problem when the program depends on the console for I/O



What we can do? When will it get fixed?










Back to top
josue.barroso



Joined: 23 Oct 2009
Posts: 3

PostPosted: Sun Oct 25, 2009 2:18 pm    Post subject: Problem Solved! Reply with quote

Thx very much Leonid Lenyashin!
It worked in both modes: External Terminal and Output Window!!!
Razz
Back to top
View user's profile Send private message
Leonid Lenyashin
Posted via mailing list.





PostPosted: Sun Oct 25, 2009 8:12 pm    Post subject: I can "debug" my project, but I can't run it.... Reply with quote

I'd appreciate you file a bug even if you have no problem now. The most
important information is your platform and your toolchain.

josue.barroso wrote:
Quote:
Thx very much Leonid Lenyashin!

It worked in both modes: External Terminal and Output Window!!!

:P










Back to top
josue.barroso



Joined: 23 Oct 2009
Posts: 3

PostPosted: Tue Oct 27, 2009 11:16 am    Post subject: Reply with quote

My platform is Windows Vista 32bits
I'm using the MinGW toolchain

But how can I file a bug?
Back to top
View user's profile Send private message
Leonid Lenyashin
Posted via mailing list.





PostPosted: Tue Oct 27, 2009 3:11 pm    Post subject: I can "debug" my project, but I can't run it.... Reply with quote

Go here:
http://www.netbeans.org/issues/enter_bug.cgi?component=cnd
You'll need to be registered in the Issuezilla.

josue.barroso wrote:
Quote:
My platform is Windows Vista 32bits

I'm using the MinGW toolchain



But how can I file a bug?










Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB