I'm trying to compile the maya example plugin manipOverride from the devkit, but got several link errors below:
error LNK2001: unsolved external reference "public: virtual class MStatus __cdecl MPxNode::dependsOn(class MPlug const &,class MPlug const &,bool &)const " (?dependsOn#MPxNode##UEBA?AVMStatus##AEBVMPlug##0AEA_N#Z) D:\Program Files (x86)\MAYA\2016\devkit\devkitBase\devkit\plug-ins\manipOverride\manipOverride.obj manipOverride
error LNK2001: unsolved external reference "public: virtual class MStatus __cdecl MPxContext::doPtrMoved(class MEvent &)" (?doPtrMoved#MPxContext##UEAA?AVMStatus##AEAVMEvent###Z) D:\Program Files (x86)\MAYA\2016\devkit\devkitBase\devkit\plug-ins\manipOverride\manipOverride.obj manipOverride
Maya2016, vs2012&vs2013. vs2012 is recommended by the official doc but still got the same errors.
I've checked the linker setting, OpenMaya.lib, OpenMayaUI.lib is included in the input libs. There're no similar problems found, anyone can help?
Its looks like you are trying to compile a plugin which has setting for 32 bit and now you compiling with x64. Probably you need to change the Solution Platform from you Configuration Manager.
Related
I am trying to set up the FLAC++ to allow me to encode/decode audio data, but when I attempt to compile I get 2 unresolved external errors:
LNK2019 unresolved external symbol "__declspec(dllimport) public: char const * __cdecl FLAC::Encoder::Stream::State::resolved_as_cstring(class FLAC::Encoder::Stream const &)const " (_imp?resolved_as_cstring#State#Stream#Encoder#FLAC##QEBAPEBDAEBV234##Z) referenced in function "public: int __cdecl"
LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl FLAC::Encoder::Stream::operator bool(void)const " (_imp??BStream#Encoder#FLAC##QEBA_NXZ) referenced in function "public: int __cdecl"
I am linking both the FLAC.lib and FLAC++.lib files from program files (C:\Program Files (x86)\FLAC\lib).
I have tried installing 4 different versions of FLAC (1.3.3, 1.3.4, 1.4.0 and 1.4.1) but the linking errors still persist.
Does anyone have any suggestion to why this might be happening or what I might be missing here?
Thanks!
Edit: I am using Visual Studio 2022. I have ensured that CMake is configured to generate for Visual Studio 2022, and am compiling FLAC from the same version.
Edit 2: I have solved this by downloading the library from the latest GitHub commit from (https://github.com/xiph/flac). I am unsure why, but all stable releases seem to result in the same linking errors.
I am quite a beginner to programming so I am sorry for my basic question.
I installed PCL 11.1 via vcpkg manager a few weeks ago and now I have realized I am missing some header files. In particular pcl/surface/concave_hull.h and some more regarding visualisation but these I don't miss that much for now.
I have tried to install PCL (v11.1) in a different way (using exe file which I found on git) and I can see the missing files there. Nevertheless when I add this location to additional include directories in visual studio (v16.8.4)I got 3 Linker errors.
Error LNK2001 unresolved external symbol "protected: virtual void __cdecl pcl::ConcaveHull<struct pcl::PointXYZ>::performReconstruction(struct pcl::PolygonMesh &)" (?performReconstruction#?$ConcaveHull#UPointXYZ#pcl###pcl##MEAAXAEAUPolygonMesh#2##Z) Meas3D C:\Users\hribh\source\repos\Meas3D\Meas3D\Meas3D\hull.obj 1
Error LNK2001 unresolved external symbol "protected: virtual void __cdecl pcl::ConcaveHull<struct pcl::PointXYZ>::performReconstruction(class std::vector<struct pcl::Vertices,class std::allocator<struct pcl::Vertices> > &)" (?performReconstruction#?$ConcaveHull#UPointXYZ#pcl###pcl##MEAAXAEAV?$vector#UVertices#pcl##V?$allocator#UVertices#pcl###std###std###Z) Meas3D C:\Users\hribh\source\repos\Meas3D\Meas3D\Meas3D\hull.obj 1
Error LNK2001 unresolved external symbol "public: void __cdecl pcl::ConcaveHull<struct pcl::PointXYZ>::reconstruct(class pcl::PointCloud<struct pcl::PointXYZ> &,class std::vector<struct pcl::Vertices,class std::allocator<struct pcl::Vertices> > &)" (?reconstruct#?$ConcaveHull#UPointXYZ#pcl###pcl##QEAAXAEAV?$PointCloud#UPointXYZ#pcl###2#AEAV?$vector#UVertices#pcl##V?$allocator#UVertices#pcl###std###std###Z) Meas3D C:\Users\hribh\source\repos\Meas3D\Meas3D\Meas3D\hull.obj 1
Does anybody know why is that and how to install complete version of PCL through vcpkg or how to get rid of those errors? Thank you.
I had the same issue with header files.
Turned out, that using vcpkg does not provide all the headers and files.
You can install pcl all in one from here, this solved my problem: http://unanancyowen.com/en/pcl181/
I know that it is a basic answer, but I hope it can help.
I'm new to C++, Visual Studio (2019) and Bullet (2.89).
I've been tying to build the Hello_World.cpp from Bullet for the past few days but I'm stuck on these 5 linking errors:
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere#btCollisionShape##UBEXAAVbtVector3##AAM#Z)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc#btCollisionShape##UBEMXZ)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold#btCollisionShape##UBEMM#Z)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexShape::project(class btTransform const &,class btVector3 const &,float &,float &,class btVector3 &,class btVector3 &)const " (?project#btConvexShape##UBEXABVbtTransform##ABVbtVector3##AAM2AAV3#3#Z)
1>Hello_World.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btSphereShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia#btSphereShape##UBEXMAAVbtVector3###Z)
There are other people who had this or a similar problem but got no answer or it didn't work for me.
setup:
I used premake to set up the VS solution, Bullet is organized in static Libraries (as projects with source code that gets compiled to lib files) and I am now trying to link them with an application-project.
all projects are using static linking (for debug).
I've referenced all bullet projects to my project.
I've even staticly linked to the lib files from bullet (and the linker can apparently see these files, I even tried giving the absolute path)
As far as I can tell the functions exist and have the same signature in the .cpp and .h files
If you need more details let me know.
(One lead I possibly got is something about different bt_double_precision? But that might not be it and the only think I could find was floating point model using different precision. But making that the same didn't do anything)
Thanks in advance!
EDIT:
I don't think this answer applies to me
What is an undefined reference/unresolved external symbol error and how do I fix it?
EDIT:
Maybe worth mentioning: The file structure of the project is really weird (dictated by premake):
solution and project files are in: bullet3-2.89\build3\vs2010
high level header files(these are the ones used by Hello_World that include other headers): bullet3-2.89\src
source and header files are subdirectories of bullet3-2.89\src
libraries: bullet3-2.89\bin
but all headers use the correct relative paths in their include and I have set the project's include and library directories to those locations
I found a workaround. Just gonna hijack one of the example projects from Bullet and use that instead. They seem to be better at VS settings than me :D
Anyway, thanks for your suggestions.
Had the same issue where just a few of the functions didn't link.
This is most likely due to the Bullet library being built with BT_USE_DOUBLE_PRECISION, meaning all btScaler will be of type double.
But the library is included without BT_USE_DOUBLE_PRECISION, meaning the program will try to link with the float versions of the functions.
But they don't exists since the built version uses doubles.
I'm attaching some external libraries to my project in C++.
These libraries make use of the opencv2 libraries.
I already added the opencv2 include files to my c/c++ properties. I also added all the relevant lib files which I googled and found to the Linker input list. (I'm running the release version, but I also tried the debug version with the "d" extension).
opencv_core230.lib
opencv_highgui230.lib
opencv_objdetect230.lib
opencv_imgproc230.lib
opencv_ml230.lib
opencv_legacy230.lib
opencv_video230.lib
I'm getting these 4 annoying linking problems regarding the setSVMDetector#HOGDescriptor.
I looked everywhere for a solution and couldn't find one.; no one really uses the setSVM function in the external program.
Here are the linking problems:
Error 14 error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class cv::_InputArray const &)" (?setSVMDetector#HOGDescriptor#cv##UAEXABV_InputArray#2##Z) C:\Users\idan\Documents\Visual Studio 2010\GraspTestingTool\GraspTestingTool\GraspTestingTool.obj GraspTestingTool
Error 15 error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class cv::_InputArray const &)" (?setSVMDetector#HOGDescriptor#cv##UAEXABV_InputArray#2##Z) C:\Users\idan\Documents\Visual Studio 2010\GraspTestingTool\GraspTestingTool\htmlGenerator.obj GraspTestingTool
Error 16 error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class cv::_InputArray const &)" (?setSVMDetector#HOGDescriptor#cv##UAEXABV_InputArray#2##Z) C:\Users\idan\Documents\Visual Studio 2010\GraspTestingTool\GraspTestingTool\sequenceTests.obj GraspTestingTool
Error 17 error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class cv::_InputArray const &)" (?setSVMDetector#HOGDescriptor#cv##UAEXABV_InputArray#2##Z) C:\Users\idan\Documents\Visual Studio 2010\GraspTestingTool\GraspTestingTool\Utilities.obj GraspTestingTool
Does anyone know how to solve this issue?
Thanks a lot!
Error is due to not adding specifice library in debug or releas mode.
use 32 bit or 64 library depending on your target machine
Add respective library of opencv in release mode -
opencv_core242.lib opencv_highgui242.lib opencv_imgproc242.lib opencv_ml242.lib
opencv_legacy242.lib opencv_video242.lib
OR If you want run program in debug mode then
use debug lib of opencv
opencv_core220d.lib
opencv_highgui220d.lib
opencv_video220d.lib
opencv_ml220d.lib
opencv_legacy220d.lib
opencv_imgproc220d.lib
opencv_objdetect242.lib
C:\opencv\build\x86\vc10\lib
Add the library file "opencv_objdetect248.lib; opencv_objdetect248d.lib;" in Project roperties-->Linker-->Input.
You need to add opencv_objdetect library. If you using debug mode add objdetect(version)d.lib, however, if you release mode add objdetect(version).lib
I'm trying to compile osgearth library with VS2010. The library uses CMake, so after setting all dependencies it generates a VS2010 solution file. However when running build in VS I get this linker error (and 200 similar ones)
Error 7 error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ofstream >::`vbase destructor'(void)" (_imp??_D?$basic_ofstream#DU?$char_traits#D#std###std##QAEXXZ) referenced in function "public: virtual void __thiscall osgEarth::DiskCache::setImage(class osgEarth::TileKey const &,struct osgEarth::CacheSpec const &,class osg::Image const *)" (?setImage#DiskCache#osgEarth##UAEXABVTileKey#2#ABUCacheSpec#2#PBVImage#osg###Z) C:\swproj\osgearth-src\src\osgEarth\Caching.obj osgEarth
I'm not very familiar with C++, is there anything else I have to set up?
You're missing a reference to std::ofstream. You either need an #include in one of your files or a reference to the standard library dll in your project.