0

I'm trying to build example advanced-flex from boost-beast git example. I installed both boost and openssl from sources, so post didn't help me. I've basic understanding of building projects, my attempt is (-I... to fix openssl fatal error: openssl/conf.h: No such file or directory):

g++ -o app main.cpp -I/usr/local/ssl/include  

I get enormous list of errors ending with:

...
main.cpp:(.text._ZN5boost4asio3ssl6detail6engine8do_writeEPvm[_ZN5boost4asio3ssl6detail6engine8do_writeEPvm]+0x3d): undefined reference to `SSL_write'
collect2: error: ld returned 1 exit status

Which leads me to post from stackoverflow I referenced earlier, I've tried then:

g++ -pthread -o qm_app main.cpp -I/usr/local/ssl/include -I/usr/local/ssl/lib -lssl -lcrypto

/usr/bin/ld: cannot find -lssl
/usr/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status

Folder usr/local/ssl/lib content:

drwxr-xr-x 4 root root    4096 мая  7 14:27 .
drwxr-xr-x 9 root root    4096 мая  7 14:27 ..
drwxr-xr-x 2 root root    4096 мая  7 14:27 engines-1.1
-rw-r--r-- 1 root root 5722096 мая  7 14:27 libcrypto.a
lrwxrwxrwx 1 root root      16 мая  7 14:27 libcrypto.so -> libcrypto.so.1.1
-rwxr-xr-x 1 root root 3428768 мая  7 14:27 libcrypto.so.1.1
-rw-r--r-- 1 root root 1043808 мая  7 14:27 libssl.a
lrwxrwxrwx 1 root root      13 мая  7 14:27 libssl.so -> libssl.so.1.1
-rwxr-xr-x 1 root root  692840 мая  7 14:27 libssl.so.1.1
drwxr-xr-x 2 root root    4096 мая  7 14:27 pkgconfig
Oleg
  • 11
  • 3
  • 2
    As option may have importance, you could try `g++ -pthread -I/usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto -o qm_app main.cpp`. Also, you should use option `-L` instead of `-I` when you specify a directory where to look for librairies – Zelnes May 07 '19 at 13:48
  • @Zelnes Thanks, but right order (at least for me): g++ -pthread -o qm_app main.cpp -I/usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto – Oleg May 07 '19 at 14:39
  • What happens when you build the example using bjam? – Vinnie Falco May 08 '19 at 15:03

0 Answers0