0
votes

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

http://i.stack.imgur.com/TziYb.jpg

1
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. - polarysekt
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 - Victor Hernandez
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. - polarysekt
@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? - Jesse
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. - Jesse

1 Answers

1
votes

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);