在使用HGE时....自己手动写了一个makefile做测试
HGE_PATH=-Ie:/extralibraries/hge/hge17/include
HGE_LIB_DIR=e:/extralibraries/hge/hge17/lib/gcc/libhge.a
main:main.o
g++ main.o -o main.exe
main.o:main.cpp
g++ -Wall -Wextra -pedantic -c main.cpp ${HGE_PATH} ${HGE_LIB_DIR} -o main.o
在MAKE时出现:
g++ main.o -o main.exe
main.o:eh_throw.cc.text+0x280): multiple definition of `mainCRTStartup'
/mingw/lib/crt2.o:crt1.c.text+0x280): first defined here
main.o:eh_throw.cc.text+0x2a0): multiple definition of `WinMainCRTStartup'
/mingw/lib/crt2.o:crt1.c.text+0x2a0): first defined here
main.o:eh_throw.cc.text+0x2c0): multiple definition of `atexit'
/mingw/lib/crt2.o:crt1.c.text+0x2c0): first defined here
main.o:eh_throw.cc.text+0x2d0): multiple definition of `_onexit'
/mingw/lib/crt2.o:crt1.c.text+0x2d0): first defined here
main.o: In function `_gxx_personality_sj0':
e:/gcc-4.2.1/mingw32/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/eh_personality.cc:640: multiple definition of `_argc'
/mingw/lib/crt2.o:crt1.c.bss+0x4): first defined here
main.o: In function `_gxx_personality_sj0':
e:/gcc-4.2.1/mingw32/libstdc++-v3/libsupc++/../../.././libstdc++-v3/libsupc++/eh_personality.cc:640: multiple definition of `_argv'
/mingw/lib/crt2.o:crt1.c.bss+0x0): first defined here
collect2: ld returned 1 exit status
mingw32-make: *** [main] Error 1
但是换一种方式却可以通过
HGE_PATH=-Ie:/extralibraries/hge/hge17/include
HGE_LIB_DIR=e:/extralibraries/hge/hge17/lib/gcc/libhge.a
main:main.o
g++ main.cpp ${HGE_PATH} ${HGE_LIB_DIR} -o main.exe
应该如何解释????