SDK C++ Linker Error [SOLVED]
Posted: 26 May 2012 05:22 PM   [ Ignore ]
New Member
Rank
Total Posts:  3
Joined  2012-05-26

Hello all.

I’ve been using Alex’s drivers for a while now with CCV but decided to write some of my own code using OpenCV/C++. Unfortunately, I ran into some problems; I think it is just a linking problem but I thought I have put all the files in the correct places.

Anyhows, I am using OpenCV2.31 and Visual Studio 2010, here is the code I am trying to compile (link):

#include <CLEye\CLEyeMulticam.h>
#include <opencv\cv.h>
#include <stdio.h>

#include <opencv\highgui.h>


int main(int argcchar** argv)
{

    
// Query for number of connected cameras
    
int numCams CLEyeGetCameraCount();

    if(
numCams == 0)
    
{
        printf
("No PS3Eye cameras detected\n");
        return -
1;
    
}
    printf
("Found %d cameras\n"numCams);
    

    return 
0;

The function CLEyeGetCameraCount is giving an ‘unresolved external symbol’ error.

I have put the CLEyeMulticam.lib file into VSudio’s ‘lib’ folder and also tried adding the SDK ‘Lib’ folder to the ‘Additional Library Directories’ in the ‘General->Linker’ settings in the ‘Property Pages’.

Thanks

Profile
 
 
Posted: 29 May 2012 01:07 AM   [ Ignore ]   [ # 1 ]
New Member
Rank
Total Posts:  1
Joined  2012-05-29

Finaly solved the problem. Needed to add the .lib file as in the following image:

PS3Eye_Dependencies.png

Profile
 
 
Posted: 29 May 2012 07:06 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

You can also use the “pragma comment” linker option. Just add the following line to your .cpp or .h file:

#pragma comment(lib, "CLEyeMulticam.lib") 
Profile
 
 
Posted: 01 June 2012 01:34 AM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  3
Joined  2012-05-26

Thanks, for that. Its been helpful in moving code around between projects (and computers).

I’ve nearly finished writing my non-threading version of the example code.

Profile
 
 
 
 


RSS 2.0     Atom Feed