I wrote a C++ library which builds fine (gcc 4.6.3), until I tried linking with openssl. I’m on Ubuntu 12.04.
Using sudo apt-get install libssl-dev the openssl includes are installed in /usr/include/openssl. But using -I /usr/include causes dozens of errors with the C++ libraries. They appear to be using /usr/local/include/ and this new include path is causing conflicts.
I see that versions of the C++ libraries are in both
/usr/include/
/usr/local/include/
with the version in /usr/include more up-to-date.
How can I direct gcc to to use /usr/include/c++ for standard libraries? And would that be the correct way to solve my problem?
You shouldn’t need to mess with
-Iflags. Headers can be included withLibraries can be linked in using
-l<library name>. For example, you would linklibsslwith: