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,
链接已复制
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.
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.
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;
}
