0

im triying to compile a object from the source http://xeat-engine.googlecode.com/svn/trunk/ using the code

g++ -c wx-config --cxxflags main.cpp

g++ -o main main.o wx-config --libs

and obtain the error

/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function _start': (.text+0x20): undefined reference tomain'

collect2: error: ld returned 1 exit status

please help me to fix the problem What could I do? IS A CAPTURE FOR MAIN.CPP

https://i.sstatic.net/TziYb.jpg

5
  • Could you show at least a snippet of main.cpp and any possible headers showing your wxApp-derived class and the wxIMPLEMENT_APP() macro? It may help diagnosis. Commented Aug 6, 2014 at 2:40
  • OK , THINK I HAVE TO COMPILE AND LINKING sites.google.com/a/case.edu/hpc-upgraded-cluster/home/… ALL FILES ARE IN THIS LINK xeat-engine.googlecode.com/svn/trunk Commented Aug 6, 2014 at 2:53
  • As I noticed you were using wxWidgets, I referred to: docs.wxwidgets.org/trunk/overview_helloworld.html --- "As in all programs there must be a 'main' function. Under wxWidgets 'main' is implemented using this macro, which creates an application instance and starts the program." --- The main() function is defined behind the scenes. Commented Aug 6, 2014 at 2:57
  • @VictorHernandez hi, how do you fix this problem? I'm also having the same problem but I don't have any knowledge about c++. I follow the answer: change IMPLEMENT_APP(xeatengine_guiApp); to wxIMPLEMENT_APP(xeatengine_guiApp); in gui/xeatengine_gui.h. still same error... Could you paste your changes? Commented Oct 27, 2014 at 1:29
  • some typo in the previous comment. Here is what I change: change IMPLEMENT_APP(xeatengine_guiApp); to wxIMPLEMENT_APP(xeatengine_guiApp); in gui/xeatengine_gui.cpp and add wxDECLARE_APP(xeatengine_guiApp); in gui/xeatengine_gui.h. Commented Oct 27, 2014 at 1:38

1 Answer 1

1

You're missing:

wxIMPLEMENT_APP(xeatengine_guiApp);

which will be expanded into a valid main() function.

NOTE: the trailing semicolon is necessary...

See also:

wxDECLARE_APP(xeatengine_guiApp);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.