ichigokurosaki
asked on
[C/C++] How to add external library to Visual Studio 2010 (pgrflycapture, pointgrey)
I usually use to compile my C/C++ files under Linux by using g++ and by adding libraries reference from command line.
At the moment, i have to compile and build a Visual Studio 2010 Premium project and I do not know how to add external libraries because I never used it.
I have to compile a PointGrey project in order to acquire images from my pointgrey firewire camera and i'm trying to compile a working project downloaded from the pointgrey website.
The problem is that VS gives me this error:
Cpp source file are in:
C:\Program Files\Point Grey Research\FlyCapture2\inclu de
C:\Program Files\Point Grey Research\FlyCapture2\inclu de\FC1
C:\Program Files\Point Grey Research\FlyCapture2\inclu de\C
Library file are in:
C:\Program Files\Point Grey Research\FlyCapture2\lib
C:\Program Files\Point Grey Research\FlyCapture2\lib\F C1
C:\Program Files\Point Grey Research\FlyCapture2\lib\C
So, in VS, I modified the configuration in this way:
In Additional Include Directories (C/C++, General tab), I added:
In Additional Dependencies, there was already specified: pgrflycapture.lib
Can you help me to understand how to add the library reference, please?
I've attached some screenshots.
VS1.PNG
VS2.PNG
VS3.PNG
At the moment, i have to compile and build a Visual Studio 2010 Premium project and I do not know how to add external libraries because I never used it.
I have to compile a PointGrey project in order to acquire images from my pointgrey firewire camera and i'm trying to compile a working project downloaded from the pointgrey website.
The problem is that VS gives me this error:
1>LINK : fatal error LNK1104: cannot open file 'pgrflycapture.lib'
Cpp source file are in:
C:\Program Files\Point Grey Research\FlyCapture2\inclu
C:\Program Files\Point Grey Research\FlyCapture2\inclu
C:\Program Files\Point Grey Research\FlyCapture2\inclu
Library file are in:
C:\Program Files\Point Grey Research\FlyCapture2\lib
C:\Program Files\Point Grey Research\FlyCapture2\lib\F
C:\Program Files\Point Grey Research\FlyCapture2\lib\C
So, in VS, I modified the configuration in this way:
In Additional Include Directories (C/C++, General tab), I added:
C:\Program Files\Point Grey Research\FlyCapture2\lib\C;C:\Progra m Files\Point Grey Research\FlyCapture2\lib\F C1;C:\Prog ram Files\Point Grey Research\FlyCapture2\lib;C :\Program Files\Point Grey Research\FlyCapture2\inclu de\FC1;..\ ..\include ;%(Additio nalInclude Directorie s)
In Additional Dependencies, there was already specified: pgrflycapture.lib
Can you help me to understand how to add the library reference, please?
I've attached some screenshots.
VS1.PNG
VS2.PNG
VS3.PNG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I solved it!
It's was a path problem!
Thanks a lot, jkr!
It's was a path problem!
Thanks a lot, jkr!
ASKER
perfect suggestion like always!
Thank you ;o)
Good that you sorted the last issue out.
Good that you sorted the last issue out.
Oh, one little correction, make that
instead...
#ifdef _MSC_VER // MS copilers only!
#pragma comment(lib,"mylib.lib")
#pragma comment(linker,"/LIBPATH:[PATH]")
#endif
instead...
ASKER
Thanks again! :)
I'll add this tip to my notes in order to remember it! :)
I'll add this tip to my notes in order to remember it! :)
ASKER
Now, VS is able to find the libraries!
Unfortunately, it gives me this error:
Why this happens?
VS seems to be a little bit difficult to use for me!
I feel more comfortable with unix :(