Compiling from Netbeans fails, but from terminal works

泪湿孤枕 提交于 2019-12-11 08:11:55

问题


I have a problem with having Netbeans compile the way I want to. I can't get Netbeans to compile my program. When I'm in the Ubuntu Terminal I can compile my program with the following command:

gcc -L/usr/local/lib -I/usr/local/include/libxml++-2.6 -I/usr/local/lib/libxml++-2.6/include  -I/usr/include/libxml2 -I/usr/include/glibmm-2.4  -I/usr/lib/i386-linux-gnu/glibmm-2.4/include -I/usr/include/sigc++-2.0  -I/usr/lib/i386-linux-gnu/sigc++-2.0/include -I/usr/include/glib-2.0  -I/usr/lib/i386-linux-gnu/glib-2.0/include -L/usr/local/lib   build/Debug/GNU-Linux-x86/cardObject.o  build/Debug/GNU-Linux-x86/visualisation.o  build/Debug/GNU-Linux-x86/monitoring.o build/Debug/GNU-Linux-x86/main.o  build/Debug/GNU-Linux-x86/player.o  build/Debug/GNU-Linux-x86/detectBiddings.o  build/Debug/GNU-Linux-x86/gameStatsObject.o  build/Debug/GNU-Linux-x86/cardOCR.o  build/Debug/GNU-Linux-x86/cardModifications.o  build/Debug/GNU-Linux-x86/geometry.o  build/Debug/GNU-Linux-x86/boardNumber.o  build/Debug/GNU-Linux-x86/cardSuit.o  build/Debug/GNU-Linux-x86/bidObject.o  build/Debug/GNU-Linux-x86/dummyCorner.o  build/Debug/GNU-Linux-x86/trayCorner.o  build/Debug/GNU-Linux-x86/logicConnection.o  build/Debug/GNU-Linux-x86/bidSuit.o  build/Debug/GNU-Linux-x86/bmCommunication.o  build/Debug/GNU-Linux-x86/imageProcessing.o  build/Debug/GNU-Linux-x86/bidOCR.o -lclsocket -lopencv_core  -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml  -lopencv_video -lcurl -lxml++-2.6 -pthread -lxml++-2.6  -lxml2 -lglibmm-2.4 -lgobject-2.0 -lsigc-2.0 -lglib-2.0  -o dist/Debug/GNU-Linux-x86/trunk

That works, but how do I set the included libraries, additional options, compile options and included directories in Netbeans to let it compile like the command above?

Thank you


回答1:


I finally figured out the problem in Netbeans. If you include the libraries (in the Linker tab) in Netbeans there is no need to add all the -l... files manually. Removing the -l... files from the Addition Options line fixed the problem for me.



来源:https://stackoverflow.com/questions/10794792/compiling-from-netbeans-fails-but-from-terminal-works

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!