I started with learning C++ a few days ago and I would like to get some data to make it more funny. I found a powerful C++ library called Unirest that can help me to get data from many APIs and after practice the basics :)
I don't know how to include libraries into my project. I fond some videos about how to do it so I just created libs
folder (like i always do when I'm programming in PHP) and I copied library files. After I included header file UNIRest.h
into my source and added the libs
directory into VS+ Directories option in Project Properties - Configuration Properties - VC+ Directories. Everything is still OK. But when I opened the header file UNIRest.h
the problem appeared:
#import "UNIHTTPRequest.h"
#import "UNIHTTPRequestWithBody.h"
#import "HttpRequest/UNISimpleRequest.h"
#import "HttpRequest/UNIBodyRequest.h"
#import "HttpResponse/UNIHTTPBinaryResponse.h"
#import "HttpResponse/UNIHTTPJsonResponse.h"
#import "HttpResponse/UNIHTTPStringResponse.h"
All of those macros are underlined and compilation failed with message:
fatal error C1083: Cannot open type library file: 'libs\unirest\unihttprequest.h': Error loading type library/DLL.
Could you please help me? Hope it's not just a stupid question because I tried to make it works whole afternoon :(
This question is related to
c++
visual-studio-2012
In code level also, you could add your lib to the project using the compiler directives #pragma.
example:
#pragma comment( lib, "yourLibrary.lib" )
Source: Stackoverflow.com