非常奇怪的MinGW ID问题-&Quot;集合2:LD返回1个退出状态&Quot;
我正在构建一个用于数据可视化的应用程序,我使用的框架非常漂亮OpenFrameworks。在Linux上,它可以完美地编译和工作,但现在是时候将它移植到Windows上了,我面临着一些非常奇怪的问题。我在谷歌上找不到相关信息。当链接时,我得到这样的信息:
mingw32-g++.exe -o binvisualisation.exe ...blah.o, blah2.o... ...lib1 lib2 lib3...
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 3 seconds)
0 errors, 0 warnings
(目标文件和库的列表很长,所以我稍微去掉了一点)
我尝试从头开始手动构建所有库,然后再次尝试,但我总是得到这样的结果。没有错误,只是不会创建任何可执行文件。不包含库通常有问题,但链接器会给出错误。我也尝试从命令行构建所有代码,并得到相同的结果。
所以,我的问题很明显,问题出在哪里?
仅供参考,我使用的Code::BLOCKS 8.02、Windows XP Home SP3和MinGW具有以下组件:
gcc-core-3.4.5-20060117-1-vista.tar.gz
gcc-g++-3.4.5-20060117-1-vista.tar.gz
mingw-runtime-3.14.tar.gz
mingw32-make-3.81-2.tar.gz
mingw-utils-0.3.tar.gz
w32api-3.11.tar.gz
binutils-2.18.50-20080109.tar.gz
gdb-6.7.50.20071127-mingw.tar.bz2
编辑: 从命令行编译时的日志(cmd.exe):
C:openFrameworksappsexamplesGraphVisualOFv2>mingw32-g++.exe -o binvisualisation.exe objeleasesrcdataAccessDBDataLoader.o objeleasesrcdataAccessDataLoader.o objeleasesrcdataAccessXMLDataLoader.o objeleasesrcdataAccesscsacapidll.o objeleasesrcengineEngine.o objeleasesrcengineconfigConfiguration.o objeleasesrcengineconfigConfigurationControler.o objeleasesrcgraphEdge.o objeleasesrcgraphGraph.o objeleasesrcgraphVertex.o objeleasesrcmain.o objeleasesrcmathAlgorithmicPositioning.o objeleasesrcmathPositioning.o objeleasesrcmathRandomPositioning.o objeleasesrcmetaLayerMetaEdge.o objeleasesrcmetaLayerMetaGraph.o objeleasesrcmetaLayerMetaVertex.o objeleasesrc estApp.o ../../../libs/openFrameworksCompiled/lib/win_cb/openFrameworks.lib ../../../libs/FreeImage/lib/win_cb/FreeImage.lib ../../../libs/rtAudio/lib/win_cb/librtaudio.a ../../../libs/rtAudio/lib/win_cb/RtAudio.a ../../../libs/rtAudio/lib/win_cb/RtAudioD.a ../../../libs/quicktime/lib/win_cb/qtmlClient.lib ../../../libs/freetype/lib/win_cb/libfreetype.a ../../../libs/glut/lib/win_cb/libglut.a ../../../libs/videoInput/lib/win_cb/videoInputLib.a ../../../libs/fmodex/lib/win_cb/libfmodex.a ../../../libs/glee/lib/win_cb/GLee.lib ../../../libs/glew/lib/win_cb/glew32s.lib ../../../libs/glu/lib/win_cb/glu32.lib ../../../libs/poco/lib/win_cb/libPocoNetmt.a ../../../libs/poco/lib/win_cb/libPocoUtilmt.a ../../../libs/poco/lib/win_cb/libPocoXMLmt.a ../../../libs/poco/lib/win_cb/libPocoFoundationmt.a ../../../libs/asa/lib/win_cb/dbcapi.lib ../../../libs/asa/lib/win_cb/dbextenv11.lib ../../../libs/asa/lib/win_cb/dblibtm.lib ../../../libs/asa/lib/win_cb/dbmlsynccli11.lib ../../../libs/asa/lib/win_cb/dbtlstm.lib ../../../libs/asa/lib/win_cb/odbc32.lib ../../../libs/asa/lib/win_cb/qany11.lib ../../../libs/dlfcn/lib/libdl.a ../../../libs/rudeconfig/lib/librudeconfig.a ../../../libs/freeglut/lib/libfreeglut.a -lopengl32 -lglu32 -ldsound -lwinmm -ldxguid -lstrmbase -lstrmiids -lz -luuid -lole32 -loleaut32 -lsetupapi -lwsock32 -lws2_32 -lIphlpapi
collect2: ld returned 1 exit status
C:openFrameworksappsexamplesGraphVisualOFv2>
解决方案
我通过设置环境直接调用ld.exe找到了解决方案
-详细
旗帜,并获得了大量信息。我实际上忘了安装opengl32开发库,所以Linker找不到它们。
相关文章