1

I've taken the great advice from this answer, checked the file list for libbotan1.10-dev and found /usr/lib/libbotan-1.10.a, so I used the linker flag -lbotan-1.10.

I've successfully been able to code and compile websocket++, json-spirit, connector/c++, and boost::lockfree::spsc_queue.

I'm now trying to use botan's passhash9 to hash passwords.

When I try to compile with

g++  -Ofast -march=native -o btServer broadcast_server_tls.cpp 
-I ~/websocketpp-master/ -std=c++0x -D_WEBSOCKETPP_CPP11_STL_ 
-D_WEBSOCKETPP_NO_CPP11_REGEX_ -lboost_regex -lboost_system 
-pthread -L/usr/lib -lssl -lcrypto -ljson_spirit -lmysqlcppconn -lbotan-1.10

g++ gives an error on the #include <botan/botan.h> line, saying "broadcast_server_tls.cpp:12:25: fatal error: botan/botan.h: No such file or directory".

To install on Ubuntu 12.10, I did apt-get install libbotan1.10-dev.

How can I correct this?

Community
  • 1
  • 1
  • as the error says, compiler cannot find `botan/botan.h`. To include file you need to have -I flag. In which directory is your botan.h residing? – Aman Deep Gautam Jul 08 '13 at 01:24

1 Answers1

3

You should compile as:

g++ "whatever_source_file" "whatever flags you are already using" -I/usr/include/botan-1.10/

Aman Deep Gautam
  • 8,091
  • 21
  • 74
  • 130
  • strange. i wonder why the flag can be used with other libraries in the style from the linked answer but not botan... –  Jul 08 '13 at 01:27
  • @Gracchus where it is used with other library? The error is pretty much clear and -I is the option used. Normally, linker would give errors like `undefined reference` which means that it already found the file(containing function definitions) but when tried to find the code for some particular function, could not find it. I guess if the path where `.a` of `botan` is present is not in default search of `linker` then you will get an undefined reference error if you remove `-l` flag for the library. – Aman Deep Gautam Jul 08 '13 at 01:32
  • @Gracchus try adding `-L/path_to_dir` where `path_to_dir` is the path of the directory wher your corresponding `.a` is present. – Aman Deep Gautam Jul 08 '13 at 01:46
  • yessir. it worked. tyvm! i first took out the `-lbotan-1.10` flag. gotta have them both: location & flag –  Jul 08 '13 at 12:39