Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » C++ program built successfully but does not run
C++ program built successfully but does not run [message #783005] Tue, 24 January 2012 22:18 Go to next message
Simon Cox is currently offline Simon CoxFriend
Messages: 3
Registered: January 2012
Junior Member
I am pretty new to eclipse and I am currently trying to generate a C++ program. Eclipse tells me that the the project is successfully built, but the program does not seem to run correctly. All I get is "expecting at least -k and -n...". I have uploaded what I feel is the relevant bit of code as the program is fairly large.

If anyone has any suggestion on where my mistake lies it would be greatly appreciated.
  • Attachment: nk_walk.cpp
    (Size: 5.83KB, Downloaded 341 times)
  • Attachment: Random.h
    (Size: 0.50KB, Downloaded 217 times)
  • Attachment: Random.cpp
    (Size: 2.42KB, Downloaded 292 times)
  • Attachment: NK.h
    (Size: 1.20KB, Downloaded 278 times)
  • Attachment: NK.cpp
    (Size: 4.58KB, Downloaded 261 times)

[Updated on: Thu, 26 January 2012 00:48]

Report message to a moderator

Re: C++ program built successfully but does not run [message #783201 is a reply to message #783005] Wed, 25 January 2012 09:20 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Simon Cox wrote on Tue, 24 January 2012 23:18
I am pretty new to eclipse and I am currently trying to generate a C++ program. Eclipse tells me that the the project is successfully built, but the program does not seem to run correctly. All I get is "expecting at least -k and -n...". I have uploaded what I feel is the relevant bit of code as the program is fairly large.

If anyone has any suggestion on where my mistake lies it would be greatly appreciated.

You should provide some more info. Is the error message from your program? At least, the message is not in the source code you attached. Does the program not run correctly or does it not run at all?....


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: C++ program built successfully but does not run [message #783566 is a reply to message #783201] Thu, 26 January 2012 00:46 Go to previous messageGo to next message
Simon Cox is currently offline Simon CoxFriend
Messages: 3
Registered: January 2012
Junior Member
Hi Axel,

Thank you for your response I have been playing around with it and now keep getting the error 'make -f Makefile all make: *** No rule to make target'. From my understanding it is because the compiler is unable to locate the makefile. However I have directed it to? A bit confused. I have uploaded the entire code, as I am unsure how to fix this.

If you have any suggestions it would be greatly appreciated.

Thank you
Re: C++ program built successfully but does not run [message #783714 is a reply to message #783566] Thu, 26 January 2012 09:32 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
In Project Properties->C/C++ Build you can define the build location (where your makefile resides). Default is project root.
Did you create the Makefile or is it generated by Eclipse? If the later is the case Eclipse should find the Makefile.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: C++ program built successfully but does not run [message #783737 is a reply to message #783714] Thu, 26 January 2012 10:54 Go to previous message
Jamie Gardiner is currently offline Jamie GardinerFriend
Messages: 4
Registered: January 2012
Junior Member
I

[Updated on: Thu, 26 January 2012 10:57]

Report message to a moderator

Previous Topic:Debugging *.S assembly sources
Next Topic:namespace name and headers not recognized
Goto Forum:
  


Current Time: Thu Apr 25 22:17:02 GMT 2024

Powered by FUDForum. Page generated in 0.02925 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top