Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 21994

Compiler doesn't find boost library libboost_serialization with gcc or clang (with clang error) on Mac Sierra

$
0
0

I downloaded boost with the accepted answer here on my Mac running Sierra. It was saved under /opt/local/include/.

Just to make sure that the library functions correctly, I tried to run this program and I am getting the following error when I run:

gcc -I"/opt/local/include/" test.cpp -lboost_locale -lboost_serialization

on the terminal:

ld: library not found for -lboost_serialization clang: error: linker command failed with exit code 1 (use -v to see invocation)

(From the answer here I also tried:

clang++ -I"/opt/local/include/" test.cpp -lboost_locale -lboost_serialization and get the same errors)

I also tried to use -I and -L:

clang++ -I"/opt/local/include/" -L"/opt/local/lib/" test.cpp -lboost_locale -lboost_serialization

but the same error is showing.

I search for "libboost_" on my computer and find that in /opt/local/lib/ there are some libboost_... files and one for serialization: libboost_serialization-mt.dylib-mt.dylib

Other than that there isn't any other files with libboost_.

Second question: why am I getting a clang error when I am using gcc? I googled to see what can be the cause but after a good hour of searching I'm still stumped as to what the issue is.


Viewing all articles
Browse latest Browse all 21994

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>