我剝去項目中的所有類,留下了三個錯誤是這樣的:使用NetBeans IDE
提高LIB錯誤在NetBeans
error_code.hpp:222: undefined reference to `boost::system::generic_category()
點擊文件 - >項目屬性 - >鏈接
旁邊的圖書館,加入libboost_system.so
它擺脫了三個不確定的參考提振::系統:: generic_category()
現在它給:
CLEAN SUCCESSFUL (total time: 123ms)
cd '/home/michaeleric/NetBeansProjects/NNW'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/michaeleric/NetBeansProjects/NNW'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux/nnw
make[2]: Entering directory `/home/michaeleric/NetBeansProjects/NNW'
mkdir -p build/Debug/GNU-Linux/_ext/d028d44d
rm -f "build/Debug/GNU-Linux/_ext/d028d44d/CGrid.o.d"
g++ -c -g -MMD -MP -MF "build/Debug/GNU-Linux/_ext/d028d44d/CGrid.o.d" -o build/Debug/GNU-Linux/_ext/d028d44d/CGrid.o ../../Desktop/NN_22_05_17/CGrid.cpp
mkdir -p dist/Debug/GNU-Linux
g++ -o dist/Debug/GNU-Linux/nnw build/Debug/GNU-Linux/_ext/d028d44d/CGrid.o -L/usr/include/boost -lboost_system
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux/nnw] Error 1
make[2]: Leaving directory `/home/michaeleric/NetBeansProjects/NNW'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/michaeleric/NetBeansProjects/NNW'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 6s)
這個錯誤的含義是什麼以及如何解決?
類,休息需要
#include </usr/include/boost/thread/thread.hpp>
#include </usr/include/boost/thread/xtime.hpp>
#include </usr/include/boost/iostreams/write.hpp>
#define byte unsigned char
#define Thread boost::thread
class CGrid
{
Thread* GetThread();
bool SetThread(Thread* thread);
};
你的程序沒有'main'功能。 –
謝謝henri。我「應該」知道 –
如果您喜歡我的回答並且有幫助,請考慮通過點擊分數旁邊的箭頭和/或將其標記爲接受的答案(通過點擊複選標記✓)。 –