Reputation: 943
I have a config file that contains:
#include "libconfig.h++"
I have installed libconfig via homebrew and I am trying to compile my c++ program so that I can use the library but I am having trouble linking to it.
The location of the libconfig .a files is located at /usr/local/Cellar/libconfig/1.4.9/lib/
The documentation says: To link with the library, specify ‘-lconfig++’ as an argument to the linker.
So I have been trying variations on g++ config.cpp -L /usr/local/Cellar/libconfig/1.4.9/lib -lconfig++ -o out.o
But I getting the same error message:
config.cpp:4:10: fatal error: 'libconfig.h++' file not found
#include "libconfig.h++"
Can someone please explain what I am doing wrong?
Upvotes: 0
Views: 2002
Reputation: 5279
There is nothing about linker. The compiler says that it can't find the file you include in your cpp. If you have installed libconfig correctly, changing #include "libconfig.h++"
to #include <libconfig.h++>
will solve the problem. If it does not help, it would mean that there is no "libconfig.h++" in your include path.
Upvotes: 1