0

I am trying to add libconfig (a .lib) to my VS13 solution. I downloaded the tar ball, extract, and build the project. The manual states:

to link with the library, specify `-lconfig++' as an argument to the linker.


From Linking dll in Visual Studio, I understand that I need to link directory to the .lib file. So I create a folder, "Libraries" and copy the .dll and .lib to it. I then set that folder as a Library Directory:

enter image description here

I understand that by right clicking the project -> Properties -> Linker -> Input, I set libconfig++.lib as an additional dependencies.

enter image description here

The provided libconfig example1 uses the following premable:

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <libconfig.h++>
using namespace libconfig;

But when I try to replicate this, I get an error enter image description here

 fatal error C1083: Cannot open include file: 'libconfig.h++': No such file or directory

If I remove #include <libconfig.h++> and using namespace libconfig; it will build. So what am I missing / doing wrong?

Community
  • 1
  • 1
Elpezmuerto
  • 5,391
  • 20
  • 65
  • 79
  • @HansPassant I changed to `#include "libconfig.h++"` but still getting `fatal error C1083: Cannot open include file: 'libconfig.h++': No such file or directory` – Elpezmuerto Mar 13 '14 at 21:19
  • Where *is* that file? Where did you copy it to? Add the directory that contains it to the Include Directories setting. – Hans Passant Mar 13 '14 at 21:26
  • As Hans says: get your include directories right so that the #include compiles. That is non-optional. The using namespace libconfig; is optional. – Matthias Mar 14 '14 at 07:38

0 Answers0