1756
Programming / Compiling on Cygwin
« on: July 04, 2010, 09:55:46 pm »I did some research on the resulting objects and it seems although I got an error at the end, there were as many .o files as .h files which makes me think make did what it was supposed toThe .o files mean the Makefile managed to compile all the individual source files (so all the include files are correct), but failed at the final step where it puts everything together into an executable (you didn't show any errors from there) since you mention there isn't one.
https://imagebin.ca/img/bPVxkQg.gif
So how do I go from these object files into OpenXcom.exe?
Running gcc *.o -o OpenXcom.exe gave me 'undefined reference' all over the place
main.o:main.cpp:(.text+0x63c): undefined reference to `std::ios_base::Init::Init()'
main.o:main.cpp:(.text+0x658): undefined reference to `std::ios_base::Init::~Init()'
main.o:main.cpp:(.gcc_except_table+0x28): undefined reference to `typeinfo for char*'
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o).text+0xa9): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
...but that might not be the right way to do it anyway
The errors you got above are because you're supposed to use g++ not gcc (if that doesn't help you might also need to add -lstdc++ afterwards), make sure you have that properly setup. In any case the Makefile should already include the full proper command.
Also if you don't mind me asking, if you're not familiar with compiling and debugging, why are you trying to compile OpenXcom yourself? There's pre-compiled Downloads freely available if you just wanna try it out.