我在Ubuntu 12.04中遇到了一些問題。在Ubuntu中,我應該在哪裏放置這些文件?
我有我想在我的code :: blocks項目中使用的SFML庫。
在SFML文件夾中有兩個子文件夾 - 包括和lib。 include包含頭文件(.h文件)。 lib包含庫文件(.so文件)。
我無法直接將庫與我的項目鏈接,因爲編譯器找不到這些文件。
我在谷歌研究並發現,我必須將sfml文件放在標準路徑中,以正確地將它們連接到代碼塊中。 那麼,我應該把這些文件放在哪個默認標準位置?
編輯:在做了大量的搜索之後,我開始瞭解如何將標題和模塊放在正確的標準位置。但是在編譯和運行(無論是從代碼塊或終端)之後,這些未定義引用錯誤就來了 -
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-graphics.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
/usr/local/lib/libsfml-window.so: undefined reference to `[email protected]_183'
collect2: ld returned 1 exit status
**/usr/include目錄** **在/ usr /本地/包括**都在那裏。我可以把它們放在其中任何一個嗎? – arandomguy
@Raj是的,它取決於編譯器,他們中的大多數都會在這兩個位置查找。 – Titus
okey因此我將include包括到/ usr/include和lib到/ usr/lib中,但是codeblocks仍然給出了很多**未定義的引用**錯誤。我需要在代碼塊中做些什麼嗎? – arandomguy