Error installing OMNET++5.1.1 on macOS10.15.6 - omnet++

I am trying to install omnet++ 5.1.1 to use with Veins/Plexe simulation. However, I am getting below error while compiling. I think I have followed the installation guide to get the additional packages in place but still no luck. Appreciate your help. Thank you.
Creating shared library: /Users/safras/src/omnetpp-5.1.1/out/clang-release/src/qtenv/liboppqtenv.dylib
Undefined symbols for architecture x86_64:
"osg::NodeVisitor::apply(osg::AutoTransform&)", referenced from:
vtable for osgEarth::FindTopMostNodeOfTypeVisitor<osgEarth::Util::SkyNode> in osgviewer.o
construction vtable for osg::NodeVisitor-in-osgEarth::FindTopMostNodeOfTypeVisitor<osgEarth::Util::SkyNode> in osgviewer.o
"osg::NodeVisitor::apply(osg::Drawable&)", referenced from:
vtable for osgEarth::FindTopMostNodeOfTypeVisitor<osgEarth::Util::SkyNode> in osgviewer.o
construction vtable for osg::NodeVisitor-in-osgEarth::FindTopMostNodeOfTypeVisitor<osgEarth::Util::SkyNode> in osgviewer.o
"osg::NodeVisitor::apply(osg::Geometry&)", referenced from:
vtable for osgEarth::FindTopMostNodeOfTypeVisitor<osgEarth::Util::SkyNode> in osgviewer.o
construction vtable for osg::NodeVisitor-in-osgEarth::FindTopMostNodeOfTypeVisitor<osgEarth::Util::SkyNode> in osgviewer.o
"osg::NodeVisitor::NodeVisitor(osg::NodeVisitor const&, osg::CopyOp const&)", referenced from:
osg::NodeVisitor::clone(osg::CopyOp const&) const in osgviewer.o
virtual thunk to osg::NodeVisitor::clone(osg::CopyOp const&) const in osgviewer.o
"osg::NodeCallback::run(osg::Object*, osg::Object*)", referenced from:
construction vtable for osg::NodeCallback-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osg::NodeCallback::operator()(osg::Node*, osg::NodeVisitor*)", referenced from:
construction vtable for osg::NodeCallback-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osg::GraphicsContext::WindowingSystemInterfaces::addWindowingSystemInterface(osg::GraphicsContext::WindowingSystemInterface*)", referenced from:
omnetpp::qtenv::OsgViewer::OsgViewer(QWidget*) in osgviewer.o
"osg::GraphicsContext::getWindowingSystemInterfaces()", referenced from:
omnetpp::qtenv::OsgViewer::OsgViewer(QWidget*) in osgviewer.o
"osg::DrawableEventCallback::run(osg::Object*, osg::Object*)", referenced from:
construction vtable for osg::DrawableEventCallback-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osg::Callback::traverse(osg::Object*, osg::Object*)", referenced from:
osg::Callback::run(osg::Object*, osg::Object*) in cameramanipulators.o
"osgGA::EventHandler::event(osg::NodeVisitor*, osg::Drawable*)", referenced from:
vtable for omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::OrbitManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::StandardManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::CameraManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::EventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osgGA::EventHandler::handle(osgGA::Event*, osg::Object*, osg::NodeVisitor*)", referenced from:
construction vtable for osgGA::EventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osgGA::EventHandler::operator()(osg::Node*, osg::NodeVisitor*)", referenced from:
vtable for omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::OrbitManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::StandardManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::CameraManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::EventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osgGA::GUIEventHandler::handle(osgGA::Event*, osg::Object*, osg::NodeVisitor*)", referenced from:
osgGA::CameraManipulator::handle(osgGA::Event*, osg::Object*, osg::NodeVisitor*) in cameramanipulators.o
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"typeinfo for osg::DrawableEventCallback", referenced from:
osg::DrawableEventCallback::isSameKindAs(osg::Object const*) const in cameramanipulators.o
virtual thunk to osg::DrawableEventCallback::isSameKindAs(osg::Object const*) const in cameramanipulators.o
virtual thunk to osg::DrawableEventCallback::isSameKindAs(osg::Object const*) const in cameramanipulators.o
construction vtable for osg::DrawableEventCallback-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"typeinfo for osgGA::EventHandler", referenced from:
osgGA::EventHandler::isSameKindAs(osg::Object const*) const in cameramanipulators.o
non-virtual thunk to osgGA::EventHandler::isSameKindAs(osg::Object const*) const in cameramanipulators.o
virtual thunk to osgGA::EventHandler::isSameKindAs(osg::Object const*) const in cameramanipulators.o
virtual thunk to osgGA::EventHandler::isSameKindAs(osg::Object const*) const in cameramanipulators.o
construction vtable for osgGA::EventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"VTT for osg::NodeCallback", referenced from:
osg::NodeCallback::cloneType() const in cameramanipulators.o
osg::NodeCallback::clone(osg::CopyOp const&) const in cameramanipulators.o
osg::NodeCallback::~NodeCallback() in cameramanipulators.o
osg::NodeCallback::~NodeCallback() in cameramanipulators.o
virtual thunk to osg::NodeCallback::cloneType() const in cameramanipulators.o
virtual thunk to osg::NodeCallback::~NodeCallback() in cameramanipulators.o
virtual thunk to osg::NodeCallback::~NodeCallback() in cameramanipulators.o
...
"VTT for osg::DrawableEventCallback", referenced from:
osg::DrawableEventCallback::cloneType() const in cameramanipulators.o
osg::DrawableEventCallback::clone(osg::CopyOp const&) const in cameramanipulators.o
osg::DrawableEventCallback::~DrawableEventCallback() in cameramanipulators.o
osg::DrawableEventCallback::~DrawableEventCallback() in cameramanipulators.o
virtual thunk to osg::DrawableEventCallback::cloneType() const in cameramanipulators.o
virtual thunk to osg::DrawableEventCallback::~DrawableEventCallback() in cameramanipulators.o
virtual thunk to osg::DrawableEventCallback::~DrawableEventCallback() in cameramanipulators.o
...
"VTT for osgGA::EventHandler", referenced from:
osgGA::EventHandler::cloneType() const in cameramanipulators.o
osgGA::EventHandler::~EventHandler() in cameramanipulators.o
osgGA::EventHandler::~EventHandler() in cameramanipulators.o
non-virtual thunk to osgGA::EventHandler::~EventHandler() in cameramanipulators.o
non-virtual thunk to osgGA::EventHandler::~EventHandler() in cameramanipulators.o
virtual thunk to osgGA::EventHandler::~EventHandler() in cameramanipulators.o
virtual thunk to osgGA::EventHandler::~EventHandler() in cameramanipulators.o
...
"vtable for osg::NodeCallback", referenced from:
osg::NodeCallback::cloneType() const in cameramanipulators.o
osg::NodeCallback::clone(osg::CopyOp const&) const in cameramanipulators.o
virtual thunk to osg::NodeCallback::cloneType() const in cameramanipulators.o
virtual thunk to osg::NodeCallback::cloneType() const in cameramanipulators.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for osg::DrawableEventCallback", referenced from:
osg::DrawableEventCallback::cloneType() const in cameramanipulators.o
osg::DrawableEventCallback::clone(osg::CopyOp const&) const in cameramanipulators.o
virtual thunk to osg::DrawableEventCallback::cloneType() const in cameramanipulators.o
virtual thunk to osg::DrawableEventCallback::cloneType() const in cameramanipulators.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for osgGA::EventHandler", referenced from:
osgGA::EventHandler::cloneType() const in cameramanipulators.o
osgGA::EventHandler::EventHandler(osgGA::EventHandler const&, osg::CopyOp const&) in cameramanipulators.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"non-virtual thunk to osgGA::EventHandler::event(osg::NodeVisitor*, osg::Drawable*)", referenced from:
vtable for omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::OrbitManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::StandardManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::CameraManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
construction vtable for osgGA::EventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"non-virtual thunk to osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"non-virtual thunk to osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"non-virtual thunk to osgGA::CameraManipulator::~CameraManipulator()", referenced from:
construction vtable for osgGA::CameraManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"non-virtual thunk to osgGA::CameraManipulator::~CameraManipulator()", referenced from:
construction vtable for osgGA::CameraManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osg::NodeCallback::run(osg::Object*, osg::Object*)", referenced from:
construction vtable for osg::NodeCallback-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osg::DrawableEventCallback::run(osg::Object*, osg::Object*)", referenced from:
construction vtable for osg::DrawableEventCallback-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osgGA::CameraManipulator::~CameraManipulator()", referenced from:
construction vtable for osgGA::CameraManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osgGA::CameraManipulator::~CameraManipulator()", referenced from:
construction vtable for osgGA::CameraManipulator-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
"virtual thunk to osgGA::GUIEventHandler::~GUIEventHandler()", referenced from:
construction vtable for osgGA::GUIEventHandler-in-omnetpp::qtenv::OverviewManipulator in cameramanipulators.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/safras/src/omnetpp-5.1.1/out/clang-release/src/qtenv/liboppqtenv.dylib] Error 1
make[1]: *** [qtenv] Error 2
make: *** [allmodes] Error 2
bash-3.2$
Any experts out there much appreciate your help. Thank you.

Related

C++ LNK2005 In Inline File

As the title suggests, I have an linker error relating to my inline file. It is complaining that my dungeon_layout header that includes my dungeon_room header(which includes the inl file) defines something twice. All my headers have guards, I only include .hpp files, and yet it still gets angry when I try and overload the assignment operator. The code which it complains is such:
Where I need assignment 1:
dungeon_room dungeon_layout::getCurrentRoom()
{
...
dungeon_room temp;
for (row = levelLayout.begin(); row != levelLayout.end(); row++)
{
for (col = row->begin(); col != row->end(); col++)
{
if (col->active)
{
...
temp = *col;
...
}
}
...
}
return temp;
}
Where I need assignment 2:
dungeon_room::dungeon_room()
{
...
roomMap = tim::tileMap(20, 20, 50);
...
}
Assignment Operator 1:
tileMap tim::tileMap::operator=(const tileMap& other)
{
// nothing...
}
Assignment Operator 2:
void dungeon_room::operator=(const dungeon_room& other)
{
// nothing...
}
Header for the Tile Manager (inl file definitions for functions)
#ifndef DUNGEON_ROOM_HPP
#define DUNGEON_ROOM_HPP
...
#include "gridManager\tileManager.hpp"
...
#endif
Header for the level layout
#ifndef DUNGEON_LAYOUT_HPP
#define DUNGEON_LAYOUT_HPP
...
#include "dungeon_room.hpp"
...
#endif
Error:
1>dungeon_room.obj : error LNK2005: "private: void __cdecl
tim::tileMap::addSprite(class sf::RectangleShape,unsigned __int64)" (?addSprite#tileMap#tim##AEAAXVRectangleShape#sf##_K#Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "private: void __cdecl tim::tileMap::addSprite(class sf::Sprite,unsigned __int64)" (?addSprite#tileMap#tim##AEAAXVSprite#sf##_K#Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: void __cdecl tim::tileMap::modifyTile(int,int,int)" (?modifyTile#tileMap#tim##QEAAXHHH#Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: void __cdecl tim::tileMap::addCollisionValue(int)" (?addCollisionValue#tileMap#tim##QEAAXH#Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: void __cdecl tim::tileMap::drawTiles(class sf::RenderWindow &,class sf::View &)" (?drawTiles#tileMap#tim##QEAAXAEAVRenderWindow#sf##AEAVView#4##Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: void __cdecl tim::tileMap::drawTiles(class sf::RenderWindow *,class sf::View &)" (?drawTiles#tileMap#tim##QEAAXPEAVRenderWindow#sf##AEAVView#4##Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: void __cdecl tim::tileMap::drawTiles(class sf::RenderWindow &)" (?drawTiles#tileMap#tim##QEAAXAEAVRenderWindow#sf###Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: void __cdecl tim::tileMap::drawTiles(class sf::RenderWindow *)" (?drawTiles#tileMap#tim##QEAAXPEAVRenderWindow#sf###Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: void __cdecl tim::tileMap::operator=(class tim::tileMap const &)" (??4tileMap#tim##QEAAXAEBV01##Z) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: __cdecl tim::tileMap::tileMap(void)" (??0tileMap#tim##QEAA#XZ) already defined in dungeon_layout.obj
1>dungeon_room.obj : error LNK2005: "public: __cdecl tim::tileMap::tileMap(float,float,float)" (??0tileMap#tim##QEAA#MMM#Z) already defined in dungeon_layout.obj
1>F:\Desktop Files\C++\Games\Dungeon_Seeker\x64\Debug\Dungeon_Seeker.exe : fatal error LNK1169: one or more multiply defined symbols found
I believe that this should be the relevant code. I've been stuck, and debugging for a while now, and it's been annoying. Please help, thanks!
The reason you are getting these errors is because the function is being compiled for each .cpp file it has been compiled in, which is then being exported multiple times, once for each .cpp file that includes your inline file.
The .inl file that contains the definition is pasted into each of the .cpp files that includes it. Meaning, when the program is linked together, there is a definition of the function, that was supposed to only be defined once, in several files. This breaks the One Definition Rule and is the reason the linker is giving you that error.
To fix it, you have three options. First, you can mark the functions as inline, which does not necessarily make the compiler inline the function, but allows the function to be defined multiple times. Second, you can move the definition of the function inside the definition of the class, which implicitly marks the functions as inline. Or you can define the function in a .cpp file.
With you code, if you still want to have the functions declared in an .inl file you can put inline in front of the definitions of the function in the error messages. In this case those functions are
tim::tileMap::addSprite
tim::tileMap::modifyTile
tim::tileMap::addCollisionValue
tim::tileMap::drawTiles //All 4 overloads
tim::tileMap::operator=
tim::tileMap::tileMap //Both constructor overloads

Point Cloud Library Build Errors in Visual Studio

I am trying to use the Point Cloud Library in conjunction with the kinect for a paper, but when I followed this tutorial, and tried to compile the solution in Visual Studio 2010, I had a couple of build errors:
pcd_write.obj : error LNK2019: unresolved external symbol "public: int __thiscall pcl::PCDWriter::writeASCII(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &,int)" (?writeASCII#PCDWriter#pcl##QAEHABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABUPointCloud2#sensor_msgs##ABV?$Matrix#M$03$00$0A#$03$00#Eigen##ABV?$Quaternion#M$0A##8#H#Z) referenced in function "public: virtual int __thiscall pcl::PCDWriter::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &,bool)" (?write#PCDWriter#pcl##UAEHABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABUPointCloud2#sensor_msgs##ABV?$Matrix#M$03$00$0A#$03$00#Eigen##ABV?$Quaternion#M$0A##8#_N#Z)
pcd_write.obj : error LNK2019: unresolved external symbol "public: int __thiscall pcl::PCDWriter::writeBinary(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &)" (?writeBinary#PCDWriter#pcl##QAEHABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABUPointCloud2#sensor_msgs##ABV?$Matrix#M$03$00$0A#$03$00#Eigen##ABV?$Quaternion#M$0A##8##Z) referenced in function "public: virtual int __thiscall pcl::PCDWriter::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &,bool)" (?write#PCDWriter#pcl##UAEHABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABUPointCloud2#sensor_msgs##ABV?$Matrix#M$03$00$0A#$03$00#Eigen##ABV?$Quaternion#M$0A##8#_N#Z)
pcd_write.obj : error LNK2019: unresolved external symbol "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print#console#pcl##YAXW4VERBOSITY_LEVEL#12#PBDZZ) referenced in function "public: int __thiscall pcl::PCDWriter::writeASCII<struct pcl::PointXYZ>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class pcl::PointCloud<struct pcl::PointXYZ> const &,int)" (??$writeASCII#UPointXYZ#pcl###PCDWriter#pcl##QAEHABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV?$PointCloud#UPointXYZ#pcl###1#H#Z)
Can someone explain why these errors are occurring and how I can fix them? All help is greatly appreciated and I always accept an answer!
You are probably using the wrong PCL version (64 bit / 32 bit). If you are generating a 64 bit CMake project, be sure to install 64bit PCL libraries for Visual Studio 2010. If you are unsure about the version of PCL being used, you can check by following the suggestion from Fraser.
You can download the correct PCL libraries from here.
I was having this same error and I found the solution to it. When you are using cmake, make sure you choose the Visual Studio 10 win64 generators if you are using the 64 bit PCL libraries. I originally used the Visual Studio 10 generators and got the exact same error. When I switched it to Visual Studio 10 win64 generators it worked like a charm.

Building Qt Messaging Framework On Mac

I'm trying to build the latest version of the QMF from the Git sources on OS X 10.6 but I keep running into this error:
"QPrivatelyImplemented<QMailMessageBodyPrivate>::~QPrivatelyImplemented()", referenced from:
QMailMessageBody::~QMailMessageBody()in qmfstoragemanager.o
QMailMessageBody::~QMailMessageBody()in qmfstoragemanager.o
PartStorer::operator()(QMailMessagePart const&)in qmfstoragemanager.o
PartLoader::operator()(QMailMessagePart&)in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessageHeaderFieldPrivate>::~QPrivatelyImplemented()", referenced from:
QMailMessageContentType::~QMailMessageContentType()in qmfstoragemanager.o
QMailMessageContentType::~QMailMessageContentType()in qmfstoragemanager.o
ReferenceLoader::operator()(QMailMessagePart&)in qmfstoragemanager.o
PartLoader::operator()(QMailMessagePart&)in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessagePartContainerPrivate>::~QPrivatelyImplemented()", referenced from:
QMailMessage::~QMailMessage()in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessageMetaDataPrivate>::~QPrivatelyImplemented()", referenced from:
QMailMessage::~QMailMessage()in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessageMetaDataPrivate>::operator=(QPrivatelyImplemented<QMailMessageMetaDataPrivate> const&)", referenced from:
QmfStorageManager::load(QString const&, QMailMessage*) in qmfstoragemanager.o
"QPrivatelyImplemented<QMailMessagePartContainerPrivate>::operator=(QPrivatelyImplemented<QMailMessagePartContainerPrivate> const&)", referenced from:
QmfStorageManager::load(QString const&, QMailMessage*) in qmfstoragemanager.o
ld: symbol(s) not found for architecture x86_64
It does, however, compile flawlessly under Ubuntu and I'm near enough positive I've compiled it on OS X previous so I'm a bit puzzled, obvious symbols not found generally means there's some source code missing, anyone come across this before I start tearing it apart?
This error occurs because compiler omits unreferenced classes away from the library.
I was able to workaround this issue by adding the following code after all the explicit template instantiations (or just add it to the end of file) in src\libraries\qmfclient\qmailinstantiations.cpp:
class reference_holder
{
struct helper
{
helper(QPrivatelyImplemented<QMailMessageBodyPrivate>* = 0)
{
}
~helper()
{
}
};
static helper helper_;
static void use_helper()
{
(void)helper_;
}
template<void(*)()>
struct helper2 {};
static helper2<&reference_holder::use_helper> helper2_;
};

Opencv2.1 application build in VS2010

I have an openCv application that builds and runs fine when using the Mutithreaded Debug Dll option for code generation property. However, I would like to run the application on any computer however, the build fails in Multithreaded Debug mode giving LNK 2005 errors, some examples are
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall
std::_Lockit::~_Lockit(void)" (??1_Lockit#std##QAE#XZ) already defined
in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall
std::_Lockit::_Lockit(int)" (??0_Lockit#std##QAE#H#Z) already defined
in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "void __cdecl
std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)"
(?_Debug_message#std##YAXPB_W0I#Z) already defined in
libcpmtd.lib(stdthrow.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall
std::_Container_base12::~_Container_base12(void)"
(??1_Container_base12#std##QAE#XZ) already defined in opencv2.obj
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: "public: __thiscall
std::exception::exception(class std::exception const &)"
(??0exception#std##QAE#ABV01##Z) already defined in
LIBCMTD.lib(stdexcpt.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: void
__thiscall std::_Container_base12::_Orphan_all(void)" (?_Orphan_all#_Container_base12#std##QAEXXZ) already defined in
opencv2.obj
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __invalid_parameter
already defined in LIBCMTD.lib(invarg.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: __CrtDbgReportW already
defined in LIBCMTD.lib(dbgrptw.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: "public: __thiscall
std::exception::exception(char const * const &)"
(??0exception#std##QAE#ABQBD#Z) already defined in
LIBCMTD.lib(stdexcpt.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: "public: virtual
__thiscall std::exception::~exception(void)" (??1exception#std##UAE#XZ) already defined in
LIBCMTD.lib(stdexcpt.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _fclose already defined
in LIBCMTD.lib(fclose.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _fprintf already defined
in LIBCMTD.lib(fprintf.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _fopen already defined
in LIBCMTD.lib(fopen.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _memmove already defined
in LIBCMTD.lib(memmove.obj)
1>MSVCRTD.lib(MSVCR100D.dll) : error LNK2005: _free already defined in
LIBCMTD.lib(dbgfree.obj)
Any suggestions would be appreciated. I am really stuck here, there is no problem with smaller programs
Thanks
P.S I also use functions from cvBlobslib and code from LIBSVM but it should not be the problem
If you change to use /MT and /MTd, then all your dependent libraries also need to have been compiled with these settings.
If this is not the case, then these dependencies require linking to the dynamic CRT and your project is trying to link to the static CRT, causing the "already defined" errors you're seeing.

Using PCL with Visual Studio 2010

I am quite new at working with libraries, and I have some problems.
I have installed PCL and all dependencies on my computer (Windows 7, 32 bit) and I can build and use simple examples like that "Simple Cloud Visualization" example. But if I want to use more complete sample, Visual Studio 2010 reports linking errors.
If I understand correctly, I did not 'include' all necessary "Additional Dependencies" in "Linker/Input". I tried to include all .lib files from lib directory, but the error report is still the same.
Does anyone know, which .lib should be added as "Additional Dependencies" to make more complete sample work? Or is problem somewhere else?
error report:
1>main.obj : error LNK2019: unresolved external symbol "public: class vtkProperty * __thiscall vtkActor::GetProperty(void)" (?GetProperty#vtkActor##QAEPAVvtkProperty##XZ) referenced in function "public: bool __thiscall pcl::visualization::PCLVisualizer::addSphere(struct pcl::PointXYZ const &,double,class std::basic_string,class std::allocator > const &,int)" (??$addSphere#UPointXYZ#pcl###PCLVisualizer#visualization#pcl##QAE_NABUPointXYZ#2#NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print#console#pcl##YAXW4VERBOSITY_LEVEL#12#PBDZZ) referenced in function "public: bool __thiscall pcl::visualization::PCLVisualizer::addSphere(struct pcl::PointXYZ const &,double,class std::basic_string,class std::allocator > const &,int)" (??$addSphere#UPointXYZ#pcl###PCLVisualizer#visualization#pcl##QAE_NABUPointXYZ#2#NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##H#Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall vtkSmartPointerBase::~vtkSmartPointerBase(void)" (??1vtkSmartPointerBase##QAE#XZ) referenced in function "public: __thiscall vtkSmartPointer::~vtkSmartPointer(void)" (??1?$vtkSmartPointer#VvtkLODActor####QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall vtkSmartPointerBase::vtkSmartPointerBase(void)" (??0vtkSmartPointerBase##QAE#XZ) referenced in function "public: __thiscall vtkSmartPointer::vtkSmartPointer(void)" (??0?$vtkSmartPointer#VvtkLODActor####QAE#XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall vtkSmartPointerBase::vtkSmartPointerBase(class vtkSmartPointerBase const &)" (??0vtkSmartPointerBase##QAE#ABV0##Z) referenced in function "public: __thiscall vtkSmartPointer::vtkSmartPointer(class vtkSmartPointer const &)" (??0?$vtkSmartPointer#VvtkProp####QAE#ABV0##Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall vtkSmartPointerBase::vtkSmartPointerBase(class vtkObjectBase *)" (??0vtkSmartPointerBase##QAE#PAVvtkObjectBase###Z) referenced in function "public: __thiscall vtkSmartPointer::vtkSmartPointer(class vtkSmartPointer const &)" (??$?0VvtkLODActor###?$vtkSmartPointer#VvtkProp####QAE#ABV?$vtkSmartPointer#VvtkLODActor#####Z)
1>main.obj : error LNK2019: unresolved external symbol "public: class vtkSmartPointerBase & __thiscall vtkSmartPointerBase::operator=(class vtkObjectBase *)" (??4vtkSmartPointerBase##QAEAAV0#PAVvtkObjectBase###Z) referenced in function "public: class vtkSmartPointer & __thiscall vtkSmartPointer::operator=(class vtkSmartPointer const &)" (??$?4VvtkLODActor###?$vtkSmartPointer#VvtkProp####QAEAAV0#ABV?$vtkSmartPointer#VvtkLODActor#####Z)
Probably you installed the wrong PCL version (64 bit / 32 bit). Check your VS version and install PCL accordingly. Note that even if you are using a 64 bit system, your compiler may be working in 32 bit.

Resources