7

I'm trying to work with Boost:asio to establish a SSL connection.

Now, my compiler says, it can't find openssl/conf.h

I'd like to know where this path is and how to fix this problem.

Thanks in advance.

Yadin20
  • 177
  • 1
  • 1
  • 5

2 Answers2

7

In my path, it is /usr/include/openssl/conf.h, and we can query dpkg to find the package that it comes from with:

dpkg -S /usr/include/openssl/conf.h

which gives the result:

libssl-dev: /usr/include/openssl/conf.h

Therefore you must run

sudo apt-get install libssl-dev

in order to get the development files for the program.

If you already have it installed in a non-standard location, you can export that into the build environment with

export LD_LIBRARY_PATH=/location/of/lib

You can also use the build-dep command to install all the necessary files for a particular program, e.g.

sudo apt-get build-dep openssl
  • Now I'm getting undefined refernece errors. Does this mean that I have to link the libs, if yes, where are they? – Yadin20 Nov 02 '12 at 16:56
  • The standard location of the development libs is `/usr/include/openssl`. –  Nov 02 '12 at 16:59
  • That are the headers, but I get undefined refernece error. Are there any shared objects? (That was my question actually) – Yadin20 Nov 02 '12 at 17:01
  • The only shared objects for `openssl` are in `/usr/lib/i386-linux-gnu/openssl-1.0.0/engines/`. –  Nov 02 '12 at 17:04
1

Header files are usually shipped in separate packages with -dev suffix. In this case the file you need is in libssl-dev.

You can use the Ubuntu Package Contents Search pages to locate the correct dev package for missing headers.

Any headers installed by the dev packages should be found automatically under the default search path, so it will usually suffice to install the required package to fix the problem.

Will Daniels
  • 1,696
  • 11
  • 10