Я пытаюсь использовать библиотеки Boost ... но безрезультатно. Я пытался следовать учебному пособию Getting Started на веб-сайте Boost (для вариантов Unix), но в процессе возникли проблемы.
Я скомпилировал библиотеки в каталог в папке «Загрузки»:
/Users/myUsername/Downloads/boostCompiled
Когда я использую полный путь к библиотеке ... Пример программы (приведенной на веб-сайте Boost) прекрасно компилируется и связывается.
g++ -o boostTesting boostTesting.cpp -I /Users/myUsername/Downloads/boostCompiled/include/ /Users/myUsername/Downloads/boostCompiled/lib/libboost_regex.a
Однако, когда я пытаюсь связать, используя опции -L и -l ... это не удается ...
g++ -o boostTesting boostTesting.cpp -I /Users/myUsername/Downloads/boostCompiled/include/ -L /Users/myUsername/Downloads/boostCompiled/lib/ -l boost_regex
ld: library not found for -lboost_regex
collect2: ld returned 1 exit status
g++ -o boostTesting boostTesting.cpp -I /Users/myUsername/Downloads/boostCompiled/include/ -L /Users/myUsername/Downloads/boostCompiled/lib/ -l libboost_regex
ld: library not found for -llibboost_regex
collect2: ld returned 1 exit status
g++ -o boostTesting boostTesting.cpp -I /Users/myUsername/Downloads/boostCompiled/include/ -L /Users/myUsername/Downloads/boostCompiled/lib/ -l regex
ld: library not found for -lregex
collect2: ld returned 1 exit status
Моя оболочка - bash ... и я установил для DYLD_LIBRARY_PATH следующее:
export DYLD_LIBRARY_PATH=/usr/local/cuda/lib:/Users/myUsername/Downloads/boostCompiled/lib
Похоже, я не использую правильное имя для связи (с параметром -l). Может кто-нибудь, пожалуйста, помогите! Заранее спасибо!