Visual Studio 2012 - getting up and running

Post Reply
LamarLatrell
Posts: 26
Joined: Tue Dec 09, 2014 4:47 pm

Visual Studio 2012 - getting up and running

Post by LamarLatrell »

Hello all,

After a bit of forum hunting and fiddling I may have found out how to set up VS2012 on 64bit machine to play with a V120:SLIM:

To code add:
#include "cameralibrary.h"
using namespace CameraLibrary;

Solution properties:
C/C++>General>Additional Include Directories - add ...\Camera SDK\include
C/C++>Preprocessor>Preprocessor Definitions - add CAMERALIBRARY_IMPORTS
Linker>General>Additional Library Directories - add ...\Camera SDK\lib
Linker>Input>Additional Dependencies - add CameraLibrary2010x64S.lib


Ten add the .dll that corresponds to the CameraLibrary20..x....lib above, to the project folder or the build folder (I forget which, or maybe both was required...)

Questions:
~What do the S and D suffixes refer to in the cameralibrary/lib files?

~I tried S and it worked... I'm using Visual Studio 2012 but is there a CameraLibrary2012x64S.lib ? (or upcoming 2015... considering...)

~I'd like to know I'm going about things optimally so in the absence of just trying them, how do I find out what they are or what to do?

~In terms of project setup and SDK/library access am I doing things optimally?

*************************************************************************************
Next up, I'm compiling now, but am getting the following warnings:

Code: Select all

1>c:\program files (x86)\optitrack\camera sdk\include\cameramanager.h(241): warning C4251: 'CameraLibrary::CameraEntry::mUID' : class 'Core::cUID' needs to have dll-interface to be used by clients of class 'CameraLibrary::CameraEntry'
1>          c:\program files (x86)\optitrack\camera sdk\include\Core/UID.h(26) : see declaration of 'Core::cUID'
1>c:\program files (x86)\optitrack\camera sdk\include\healthmonitor.h(37): warning C4251: 'CameraLibrary::cHealthItem::ID' : class 'Core::cUID' needs to have dll-interface to be used by clients of class 'CameraLibrary::cHealthItem'
1>          c:\program files (x86)\optitrack\camera sdk\include\Core/UID.h(26) : see declaration of 'Core::cUID'
The gist being about 'Core::cUID' and dll-interfaces.

Is this something I can ignore?
At the least It'd be nice to unclutter my build output - can I fix this?

Quite a few questions, but they're all related - thanks for any input :)
LamarLatrell
Posts: 26
Joined: Tue Dec 09, 2014 4:47 pm

Re: Visual Studio 2012 - getting up and running

Post by LamarLatrell »

Project is on hold until I get this sorted...

I am using 2 other libraries for this project at the moment but ttempts at incorporating the camera SDK into the project have failed.

I can get the SDK and camera input working on its own, like the examples - and figured I could start the project setup again with a optitrack and copy and paste the code into it.

But one of the libraries has similarly forced my hand into it being the starting point already...

The libraries are openCV 2.5.4 and DLIB 18.11

Looking at the basic examples and trying to include 'supportcode.cpp' and supportcode.h ends up with it complaining about 'TimerProc' in PopUpWaitingDialog, so I comment that out in the .cpp and .h and use 'CameraManager::X().WaitForInitialization();' instead.

Now I'm getting a pile of 'error LNK2019: unresolved external symbol' errors.

I suspect it's all to do with setting up the project correctly and linking the correct libraries ?

Help appreciated, as I'm twiddling thumbs in the meantime. :geek:
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Visual Studio 2012 - getting up and running

Post by beckdo »

Hey Lamar,

Here is some information for you regarding the Camera SDK.

First off, I think you missed one preprocessor that is important. In addition to CAMERALIBRARY_IMPORTS, you also want CORE_IMPORTS. This should get rid of the warnings you are seeing regarding Core::cUID.

Secondly, the S and D suffixes refer to static and dynamic run-time linkage of the library to the MS run-times (compiler settings /MT vs /MD). If you go into your VC project settings General->C/C++ Code Generation->Run-Time Library, if you're using one of the DLL options there (/MD or /MDd) link against the 'D' build of the Camera SDK, if you're statically linking (/MT or /MTd) link against the 'S' build of the Camera SDK.

Beyond that, I believe getting your solution setup to compile all of your third party libraries is just going to take a little elbow grease and not necessarily anything related to the Camera SDK. I have compiled the Camera SDK against OpenCV in the past without any issue.

Good luck!
LamarLatrell
Posts: 26
Joined: Tue Dec 09, 2014 4:47 pm

Re: Visual Studio 2012 - getting up and running

Post by LamarLatrell »

Thanks for the reply

I actually just 3hrs ago found the CORE_IMPORTS thing in an example so solved that. Also some extra directory carry on in the import settings like: '../..'

The errors as you suggest have gone - which is nice.

Is there a sample or tutorial that takes people through the settings or is it a case of reverse engineering, forum hunting, try and see? I'm ok with that ('elbow grease' as you say) but it does get a bit questionable when the forums threads have incomplete/contradictory info (setFrameRate for example).

Thanks for the info re. S and D - ok! Still though, I need to research what that actually means :shock: (currently loading favorite internet search site ...)

At the moment S seems to work.
Post Reply