我想交叉編譯telldus-core,以便能夠在我的Synology NAS上使用Tellstick。我開始用這個命令運行的CMake:如何獲得pthread處理權限?
[email protected]:/usr/local/src/telldus-core-2.1.1/build$ cmake -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabi-gcc-4.7 -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabi-g++-4.7 -DCMAKE_INSTALL_PREFIX=/opt -pthread ..
這導致了以下的輸出:
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
然後運行使結果:
[ 98%] Building CXX object tdtool/CMakeFiles/tdtool.dir/main.cpp.o
Linking CXX executable tdtool
/usr/local/src/telldus-core-2.1.1/build/client/libtelldus-core.so: undefined reference to `pthread_create'
/usr/local/src/telldus-core-2.1.1/build/client/libtelldus-core.so: undefined reference to `pthread_join'
collect2: fel: ld returnerade avslutningsstatus 1
make[2]: *** [tdtool/tdtool] Fel 1
make[1]: *** [tdtool/CMakeFiles/tdtool.dir/all] Fel 2
make: *** [all] Fel 2
[email protected]:/usr/local/src/telldus-core-2.1.1/build$
我應該怎麼做來解決這個?
,我會從刪除須藤帖子。有人可能會看它... – Bengt62
把-pthread作爲gcc和g ++的編譯器標誌在CMakeLists.txt中做了訣竅,謝謝! – Bengt62
取而代之。 – Anders