Items with no label
3335 Discussions

Error in new Project SDK R3

idata
Employee
1,623 Views

Hi,

I'm new with the Intel SDK R3. I have an SR300 camera and I want to prove some code on it. I'm trying to create my own project based on the sample 'CameraViewer.cpp' and it doesn't work.

The error that appears is "LINK2001 external symbol PXCSession_CreateFromPath unsolved".

The code I put in the new project is this one:

# include

# include "RealSense/SenseManager.h"

# include "RealSense/SampleReader.h"

# include "util_cmdline.h"

# include "util_render.h"

# include

using namespace Intel::RealSense;

int wmain(int argc, WCHAR* argv[]) { //int main()// int wmain() //int main()//

/* Creates an instance of the SenseManager */

 

SenseManager *pp = SenseManager::CreateInstance();

 

if (!pp) {

 

wprintf_s(L"Unable to create the SenseManager\n");

 

return 3;

 

}

return 0;

}

Can anyone help me?

Thanks in advance,

0 Kudos
11 Replies
MartyG
Honored Contributor III
398 Views

One of the causes of the LNK2001 compiler error can apparently be when you are asking the program to look for something that does not exist. I'll do my best to work through possible causes with you.

The first thing I would try is to remove the line # include , as this is apparently a legacy instruction related to old MS-DOS compiler programs and is not needed by modern C compilers and is not part of the C standards.

0 Kudos
idata
Employee
398 Views

Thanks for the answer!

I remove that line and It's still not working... I have another error (that appears before too)

-LNK2001 external symbol PXCSession_CreateFromPath unsolved

-LNK11201 1 external unsolved

0 Kudos
MartyG
Honored Contributor III
398 Views

Are you using a C# compiler? There is apparently no need for includes in the C# language - they are used in C and C++ languages.

Confirmed: CameraViewer.cpp is a C++ program. There does not seem to be a C# version of it.

https://software.intel.com/sites/landingpage/realsense/camera-sdk/v2016r3/documentation/html/sample_camera_viewer_cpp.html Sample: CameraViewer [C++]

This is fine if you are using a C++ compiler. If you are trying to use this listing in a C# compiler though, it would be like trying to run Windows programs on an iPhone.

0 Kudos
idata
Employee
398 Views

I've created a new project based on C++ in Visual Studio, so I think I'm using a right compiler.

0 Kudos
MartyG
Honored Contributor III
398 Views

Ok, that's good to know. A couple of people fixed that error just by creating a new project file and copy-and-pasting their listing into the new project file. So that quick test may be worth trying.

0 Kudos
idata
Employee
398 Views

Sorry, maybe I'm goint to make a fool question but, what do you mean about "their listing"?

0 Kudos
MartyG
Honored Contributor III
398 Views

There's no such thing as a silly question. I mean copying and pasting their program code.

I went back to my copy of the old RealSense PDF 'Getting Started' manual from 2014 and found this C++ code listing that creates the SenseManager like you are trying to do.

# include

# include

# include "pxcsensemanager.h"

int wmain(int argc, WCHAR* argv[]) {

// create the PXCSenseManager

PXCSenseManager *psm=0;

psm = PXCSenseManager::CreateInstance();

if (!psm) {

wprintf_s(L"Unable to create the PXCSenseManager\n");

return 1;

}

// Retrieve the underlying session created by the PXCSenseManager.

// The returned instance is an PXCSenseManager internally managed object.

// Note: Do not release the session!

PXCSession *session;

session = psm->QuerySession();

if (session == NULL) {

wprintf_s(L"Session not created by PXCSenseManager\n");

return 2;

}

// query the session version

PXCSession::ImplVersion ver;

ver = session->QueryVersion();

// print version to console

wprintf_s(L" Hello Intel RSSDK Version %d.%d \n",ver.major, ver.minor);

// enumerate all available modules that are automatically loaded with the RSSDK

for (int i=0;;i++) {

PXCSession::ImplDesc desc;

if ( session->QueryImpl(0,i,&desc) < PXC_STATUS_NO_ERROR ) break;

// Print the module friendly name and iuid (interface unique ID)

wprintf_s(L"Module[%d]: %s\n",i,desc.friendlyName);

wprintf_s(L" iuid=%x\n",desc.iuid);

}

// close the streams (if any) and release any session and processing module instances

psm->Release();

system("pause");

return 0;

}

0 Kudos
idata
Employee
398 Views

I've copied and pasted your code and compiled in my project and the same error appears... :/

0 Kudos
MartyG
Honored Contributor III
398 Views

Here is the page from the manual on setting up a RealSense C++ development environment. Please check it to see if you have done it all.

0 Kudos
idata
Employee
398 Views

Ok, that was the mistake... now it works fine, thanks!

0 Kudos
MartyG
Honored Contributor III
398 Views

Great, glad I could help. Good luck!

0 Kudos
Reply