我在Ubuntu 10.10的全新安裝版本上安裝cminpack 1.1.2。「安裝cminpack時未定義引用'strnstr'」
當cminpack文件夾中運行sudo make
,52%發生folloing錯誤:
[ 52%] Building C object examples/CMakeFiles/genf77tests.dir/genf77tests.c.o /usr/lib/cminpack-1.1.2/examples/genf77tests.c: In function ‘main’: /usr/lib/cminpack-1.1.2/examples/genf77tests.c:44: warning: assignment makes pointer from integer without a cast /usr/lib/cminpack-1.1.2/examples/genf77tests.c:86: warning: comparison between pointer and integer Linking C executable genf77tests CMakeFiles/genf77tests.dir/genf77tests.c.o: In function `main': genf77tests.c:(.text+0xb5): undefined reference to `strnstr' genf77tests.c:(.text+0x2a9): undefined reference to `strnstr' collect2: ld returned 1 exit status make[2]: *** [examples/genf77tests] Error 1 make[1]: *** [examples/CMakeFiles/genf77tests.dir/all] Error 2 make: *** [all] Error 2
我看過裏面genf77tests.c
,並#include <string.h>
是存在的,所以我不明白爲什麼有問題的發現strnstr
。
有什麼我可以解決這個問題嗎?
工作過一次,感謝。我只是#在問題文件中包含了我自己的strnstr.c。 – 2011-02-14 10:48:17