Pixar USD LNK2019: unresolved external symbol - c++

I'm working on a C++ program that creates a .usda file using the Python 3 pre-built libraries from Nvidia (https://developer.nvidia.com/usd). There are a lot of external libraries, and I can't pin down which one is causing a bunch of compiler issues. There are a handful of header files (stage.h, mesh.h to be specific) that will prevent my program from compiling. Other header files I've used from the package don't cause these errors.
I gather from research that I'm potentially missing an include/lib directory or something was compiled on a different version, but how can I find which file(s) are missing or compiled improperly?
I'm using Windows 10, Visual Studio 2017, Python 3.6, and Boost 1.68. Nvidia libraries are in C:\USDP3
Includes: C:\USDP3\include C:\Program Files\boost_1_68_0
Libraries: C:\USDP3\lib C:\Program Files\boost_1_68_0 C:\USDP3\libs
Example code:
#include "pch.h"
#define NOMINMAX
#define TBB_USE_ASSERT 0
#define TBB_USE_THREADING_TOOLS 0
#include "pxr/pxr.h"
#include "pxr/usd/usd/stage.h"
#include <iostream>
PXR_NAMESPACE_USING_DIRECTIVE
int main(int argc, char* argv[])
{
//Create Stage
UsdStage::CreateNew("Test.usda");
std::cout << "Hello World!\n";
}
Causes these errors:
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static char * * pxrInternal_v0_19__pxrReserved__::Sdf_Pool<struct pxrInternal_v0_19__pxrReserved__::Sdf_PathPropTag,24,8,16384>::_regionStarts" (__imp_?_regionStarts#?$Sdf_Pool#USdf_PathPropTag#pxrInternal_v0_19__pxrReserved__##$0BI#$07$0EAAA##pxrInternal_v0_19__pxrReserved__##0PAPEADA)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimPathNode::~Sdf_PrimPathNode(void)" (__imp_??1Sdf_PrimPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_MapperArgPathNode::~Sdf_MapperArgPathNode(void)" (__imp_??1Sdf_MapperArgPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_ExpressionPathNode::~Sdf_ExpressionPathNode(void)" (__imp_??1Sdf_ExpressionPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimPartPathNode::operator delete(void *)" (__imp_??3Sdf_PrimPartPathNode#pxrInternal_v0_19__pxrReserved__##SAXPEAX#Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimPropertyPathNode::~Sdf_PrimPropertyPathNode(void)" (__imp_??1Sdf_PrimPropertyPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_TargetPathNode::~Sdf_TargetPathNode(void)" (__imp_??1Sdf_TargetPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PropPartPathNode::operator delete(void *)" (__imp_??3Sdf_PropPartPathNode#pxrInternal_v0_19__pxrReserved__##SAXPEAX#Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl pxrInternal_v0_19__pxrReserved__::Tf_RefPtr_UniqueChangedCounter::_RemoveRef(class pxrInternal_v0_19__pxrReserved__::TfRefBase const *)" (__imp_?_RemoveRef#Tf_RefPtr_UniqueChangedCounter#pxrInternal_v0_19__pxrReserved__##SA_NPEBVTfRefBase#2##Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_RelationalAttributePathNode::~Sdf_RelationalAttributePathNode(void)" (__imp_??1Sdf_RelationalAttributePathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_MapperPathNode::~Sdf_MapperPathNode(void)" (__imp_??1Sdf_MapperPathNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: void __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PathNode::_RemovePathTokenFromTable(void)const " (__imp_?_RemovePathTokenFromTable#Sdf_PathNode#pxrInternal_v0_19__pxrReserved__##IEBAXXZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class pxrInternal_v0_19__pxrReserved__::TfRefPtr<class pxrInternal_v0_19__pxrReserved__::UsdStage> __cdecl pxrInternal_v0_19__pxrReserved__::UsdStage::CreateNew(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum pxrInternal_v0_19__pxrReserved__::UsdStage::InitialLoadSet)" (__imp_?CreateNew#UsdStage#pxrInternal_v0_19__pxrReserved__##SA?AV?$TfRefPtr#VUsdStage#pxrInternal_v0_19__pxrReserved__###2#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##W4InitialLoadSet#12##Z)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: __cdecl pxrInternal_v0_19__pxrReserved__::Sdf_PrimVariantSelectionNode::~Sdf_PrimVariantSelectionNode(void)" (__imp_??1Sdf_PrimVariantSelectionNode#pxrInternal_v0_19__pxrReserved__##AEAA#XZ)
1>test1.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) private: static char * * pxrInternal_v0_19__pxrReserved__::Sdf_Pool<struct pxrInternal_v0_19__pxrReserved__::Sdf_PathPrimTag,24,8,16384>::_regionStarts" (__imp_?_regionStarts#?$Sdf_Pool#USdf_PathPrimTag#pxrInternal_v0_19__pxrReserved__##$0BI#$07$0EAAA##pxrInternal_v0_19__pxrReserved__##0PAPEADA)'

You should have following things in your compilation step setup properly:
Preprocessor flags:
TBB_USE_DEBUG=0
YY_NO_UNISTD_H
BOOST_ALL_DYN_LINK
BOOST_PYTHON_NO_PY_SIGNATURES
BUILD_OPTLEVEL_DEV
NDEBUG
NOMINMAX
_CRT_SECURE_NO_WARNINGS
_SCL_SECURE_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
_CRT_NONSTDC_NO_DEPRECATE
NO_WARN_MBCS_MFC_DEPRECATION
Include Directories: <usd_install>\include;<usd_install>\include\boost-1_70;<Python374>\include
Libraries to link against: usd_ms.lib(when USD is compiled as monolithic shared lib)
Else, basic ones: arch.lib;pxOsd.lib;sdf.lib;usd.lib;vt.lib;tf.lib;
Render: hd.lib;hdx.lib;
More: gf.lib;cameraUtil.lib;trace.lib;hf.lib;(depending on which ones you are using.)
Their counterpart dlls should discoverable or best should be in same dir. as your executable.
Check USD's cmake files to get better idea on what to include.

Related

Using jsoncpp dll to build another dll project : link time issues

I am using json-cpp lib to build another dll project in Visual studio 2008.
Linker settings :
output file is a dll
Input tab : I have added the json cpp lib in additional dependencies
I get the following unresolved symbols given below
Also tried defining JSON_DLL to JSON_API, but it didnt work.
If there is a fix for this problem?
.. error LNK2001: unresolved external symbol "protected: bool cdecl Json::ValueIteratorBase::isEqual(class Json::ValueIteratorBase const &)const " (?isEqual#ValueIteratorBase#Json##IEBA_NAEBV12##Z)
.. error LNK2001: unresolved external symbol "protected: void cdecl Json::ValueIteratorBase::increment(void)" (?increment#ValueIteratorBase#Json##IEAAXXZ)
.. error LNK2001: unresolved external symbol "protected: class Json::Value & cdecl Json::ValueIteratorBase::deref(void)const " (?deref#ValueIteratorBase#Json##IEBAAEAVValue#2#XZ)
.. error LNK2001: unresolved external symbol "public: cdecl Json::ValueIterator::ValueIterator(class Json::ValueIterator const &)" (??0ValueIterator#Json##QEAA#AEBV01##Z)
.. error LNK2001: unresolved external symbol "public: virtual class _STL::basic_string,class _STL::allocator > cdecl Json::FastWriter::write(class Json::Value const &)" (?write#FastWriter#Json##UEAA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL##AEBVValue#2##Z)
.. error LNK2001: unresolved external symbol "public: class _STL::basic_string,class _STL::allocator > cdecl Json::Value::asString(void)const " (?asString#Value#Json##QEBA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL##XZ)
.. error LNK2001: unresolved external symbol "public: class Json::Value cdecl Json::ValueIteratorBase::key(void)const " (?key#ValueIteratorBase#Json##QEBA?AVValue#2#XZ)
.. error LNK2001: unresolved external symbol "public: class Json::Value & cdecl Json::Value::operator" (??AValue#Json##QEAAAEAV01#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL###Z)
.. error LNK2001: unresolved external symbol "public: class Json::Value & cdecl Json::Value::operator" (??AValue#Json##QEAAAEAV01#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL###Z)
.. error LNK2001: unresolved external symbol "public: bool cdecl Json::Reader::parse(class _STL::basic_string,class _STL::allocator > const &,class Json::Value &,bool)" (?parse#Reader#Json##QEAA_NAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#_STL###_STL##AEAVValue#2#_N#Z)

Linker errors with wxTreeListCtrl

Developing an app with wxWidgets even though im fairly new too the library, and need some help fixing these linker problem;
i tried google first with no luck.
1>mainwindow.obj : error LNK2001: unresolved external symbol "char const * const wxTreeListCtrlNameStr" (?wxTreeListCtrlNameStr##3QBDB)
1>mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual class wxEventHashTable & __thiscall wxTreeListCtrl::GetEventHashTable(void)const " (?GetEventHashTable#wxTreeListCtrl##MBEAAVwxEventHashTable##XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "protected: virtual struct wxEventTable const * __thiscall wxTreeListCtrl::GetEventTable(void)const " (?GetEventTable#wxTreeListCtrl##MBEPBUwxEventTable##XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "private: int __thiscall wxTreeListCtrl::DoInsertColumn(class wxString const &,int,int,enum wxAlignment,int)" (?DoInsertColumn#wxTreeListCtrl##AAEHABVwxString##HHW4wxAlignment##H#Z)
1>mainwindow.obj : error LNK2001: unresolved external symbol "private: virtual class wxWindowList __thiscall wxTreeListCtrl::GetCompositeWindowParts(void)const " (?GetCompositeWindowParts#wxTreeListCtrl##EBE?AVwxWindowList##XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "private: void __thiscall wxTreeListCtrl::Init(void)" (?Init#wxTreeListCtrl##AAEXXZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall wxTreeListCtrl::~wxTreeListCtrl(void)" (??1wxTreeListCtrl##UAE#XZ)
1>mainwindow.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxTreeListCtrl::Create(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,class wxString const &)" (?Create#wxTreeListCtrl##QAE_NPAVwxWindow##HABVwxPoint##ABVwxSize##JABVwxString###Z)
i tried to format this into a code, but its so hard to do on this site
You need to include the advanced library in the list of wx libraries linked to.
This is mentioned in the wxTreeListCtrl documentation at http://docs.wxwidgets.org/trunk/classwx_tree_list_ctrl.html
The documentation of every wxwidgets class mentions which library needs to be linked with when you use the class.

C++: "unresolved external symbol" when creating .dll in VS2010 after the .lib sucecssfully builds

This is the first time I have attempted to create a .dll, that will be used as a plugin to a 3rd party app.
I created a .dll project in VS210...New Project -> Win32 Console Application -> .dll + Empty Project options.
Then I added in the files I wanted to use and included the various include / dependency libs the code required. Furthermore, set the linker to include the output .lib
Configuration Properties -> Linker -> Advanced -> Import Library - $(OutDir)$(TargetName).lib
While the .lib is successfully compiled, as soon as VS tries to then build the .dll I get a load of "unresolved external symbol" errors relating to all the defined function names.
ClCompile:
SOMPlugin.cpp
Link:
Creating library F:\Data\My Documents\Visual Studio 2010\Projects\Plugin-SOM - Copy\Release\Plugin-SOM.lib and object F:\Data\My Documents\Visual Studio 2010\Projects\Plugin-SOM - Copy\Release\Plugin-SOM.exp
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall SOMPlugin::metaObject(void)const " (?metaObject#SOMPlugin##UBEPBUQMetaObject##XZ)
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall SOMPlugin::qt_metacast(char const *)" (?qt_metacast#SOMPlugin##UAEPAXPBD#Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall SOMPlugin::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#SOMPlugin##UAEHW4Call#QMetaObject##HPAPAX#Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::updateView(void)" (?updateView#SOMPlugin##MAEXXZ)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::updatedObject(int,class UpdateType const &)" (?updatedObject#SOMPlugin##MAEXHABVUpdateType###Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::addToolbox(class QString,class QWidget *)" (?addToolbox#SOMPlugin##MAEXVQString##PAVQWidget###Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::log(class QString)" (?log#SOMPlugin##MAEXVQString###Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall SOMPlugin::log(enum Logtype,class QString)" (?log#SOMPlugin##MAEXW4Logtype##VQString###Z)
SOMPlugin.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall SOMPlugin::~SOMPlugin(void)" (??1SOMPlugin##UAE#XZ) referenced in function "public: virtual void * __thiscall SOMPlugin::`scalar deleting destructor'(unsigned int)" (??_GSOMPlugin##UAEPAXI#Z)
SOMPlugin.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const SOMPlugin::staticMetaObject" (?staticMetaObject#SOMPlugin##2UQMetaObject##B)
F:\Data\My Documents\Visual Studio 2010\Projects\Plugin-SOM\Release\Plugin-SOM.dll : fatal error LNK1120: 9 unresolved externals
Any help would be much appreciated.
The lib will be generated even if you get linker errors. Let's look at one:
SOMPlugin.obj : error LNK2001: unresolved external symbol "public:
virtual struct QMetaObject const * __thiscall
SOMPlugin::metaObject(void)const "
(?metaObject#SOMPlugin##UBEPBUQMetaObject##XZ)
This is telling you that you haven't implemented the method SOMPlugin::metaObject(void)const. Have you?
The rest are similar, other than
SOMPlugin.obj : error LNK2001: unresolved external symbol "public:
static struct QMetaObject const SOMPlugin::staticMetaObject"
(?staticMetaObject#SOMPlugin##2UQMetaObject##B)
In this case, you need a definition for the static member outside the class definition, in an implementation file.

Qt Socket problems

I can't figure out why I'm getting these errors. I'm using Qt 4.7.4. I'm trying to make a client/server program which uses sockets to communicate. I have working code (works in visual studio 2008) with the winsock2 library. This code refuses to work with Qt, I tried for a a couple of days. I keep getting linker errors, so I decided to try to start from scratch with QTcpSocket. I included all the required include paths in the .pro file, and I am getting linker errors.
This is my client class:
toplevelcomms.h
#ifndef TOPLEVELCOMMS_H
#define TOPLEVELCOMMS_H
#include <QObject>
#include "inireader.h"
#include "WinSock2.h"
#include <QDialog>
#include <qtcpsocket.h>
#include <qhostaddress.h>
/** This class sends/receives information through sockets.
*
*/
class TopLevelComms : public QObject
{
Q_OBJECT
public:
TopLevelComms(QString hostIP, quint16 hostPort);
void connect();
private:
QTcpSocket *tcpSocket;
QHostAddress hostAddress;
quint16 hostPort;
};
#endif // TOPLEVELCOMMS_H
toplevelcomms.cpp
#include "toplevelcomms.h"
#include "stdio.h"
TopLevelComms::TopLevelComms(QString hostIP, quint16 hostPort)
{
tcpSocket = new QTcpSocket();
hostAddress.setAddress(hostIP);
this->hostPort = hostPort;
}
void TopLevelComms::connect(){
//tcpSocket->connectToHost();
}
This is the .pro file
include( $${PWD}/../qwtbuild.pri )
include( $${PWD}/../qwtconfig.pri )
QT += core gui
TARGET = TSLSuite
TEMPLATE = app
... // *all my files are declared here*
CONFIG += qwt
INCLUDEPATH += $${PWD}/../include
INCLUDEPATH += C:/QtSDK/Desktop/Qt/4.7.4/msvc2008/include/Qt
INCLUDEPATH += C:/QtSDK/Simulator/Qt/msvc2008/bin
INCLUDEPATH += C:/QtSDK/Simulator/Qt/msvc2008/include/QtNetwork
LIBS += -LC:/Qwt-6.0.1/lib -lqwt
LIBS += -LC:/Qt/4.7.4/lib -lQtSvg
This is the output :
11:33:57: Running build steps for project TSLSuite...
11:33:57: Configuration unchanged, skipping qmake step.
11:33:57: Starting: "C:\QtSDK\QtCreator\bin\jom.exe"
C:\QtSDK\QtCreator\bin\jom.exe -nologo -j 2 -f Makefile.Release all
linking release\TSLSuite.exe
toplevelcomms.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QHostAddress::~QHostAddress(void)" (__imp_??1QHostAddress##QAE#XZ) referenced in function __unwindfunclet$??0TopLevelComms##QAE#VQString##G#Z$0
toplevelcomms.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QHostAddress::setAddress(class QString const &)" (__imp_?setAddress#QHostAddress##QAE_NABVQString###Z) referenced in function "public: __thiscall TopLevelComms::TopLevelComms(class QString,unsigned short)" (??0TopLevelComms##QAE#VQString##G#Z)
toplevelcomms.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QTcpSocket::QTcpSocket(class QObject *)" (__imp_??0QTcpSocket##QAE#PAVQObject###Z) referenced in function "public: __thiscall TopLevelComms::TopLevelComms(class QString,unsigned short)" (??0TopLevelComms##QAE#VQString##G#Z)
toplevelcomms.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QHostAddress::QHostAddress(void)" (__imp_??0QHostAddress##QAE#XZ) referenced in function "public: __thiscall TopLevelComms::TopLevelComms(class QString,unsigned short)" (??0TopLevelComms##QAE#VQString##G#Z)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall QTcpSocket::metaObject(void)const " (?metaObject#QTcpSocket##UBEPBUQMetaObject##XZ)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QTcpSocket::qt_metacast(char const *)" (?qt_metacast#QTcpSocket##UAEPAXPBD#Z)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QTcpSocket::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#QTcpSocket##UAEHW4Call#QMetaObject##HPAPAX#Z)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QAbstractSocket::isSequential(void)const " (?isSequential#QAbstractSocket##UBE_NXZ)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall QAbstractSocket::close(void)" (?close#QAbstractSocket##UAEXXZ)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QAbstractSocket::atEnd(void)const " (?atEnd#QAbstractSocket##UBE_NXZ)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual __int64 __thiscall QAbstractSocket::bytesAvailable(void)const " (?bytesAvailable#QAbstractSocket##UBE_JXZ)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual __int64 __thiscall QAbstractSocket::bytesToWrite(void)const " (?bytesToWrite#QAbstractSocket##UBE_JXZ)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QAbstractSocket::canReadLine(void)const " (?canReadLine#QAbstractSocket##UBE_NXZ)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QAbstractSocket::waitForReadyRead(int)" (?waitForReadyRead#QAbstractSocket##UAE_NH#Z)
toplevelcomms.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall QAbstractSocket::waitForBytesWritten(int)" (?waitForBytesWritten#QAbstractSocket##UAE_NH#Z)
toplevelcomms.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __thiscall QAbstractSocket::readData(char *,__int64)" (?readData#QAbstractSocket##MAE_JPAD_J#Z)
toplevelcomms.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __thiscall QAbstractSocket::readLineData(char *,__int64)" (?readLineData#QAbstractSocket##MAE_JPAD_J#Z)
toplevelcomms.obj : error LNK2001: unresolved external symbol "protected: virtual __int64 __thiscall QAbstractSocket::writeData(char const *,__int64)" (?writeData#QAbstractSocket##MAE_JPBD_J#Z)
toplevelcomms.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QTcpSocket::~QTcpSocket(void)" (__imp_??1QTcpSocket##UAE#XZ) referenced in function "public: virtual void * __thiscall QTcpSocket::`scalar deleting destructor'(unsigned int)" (??_GQTcpSocket##UAEPAXI#Z)
release\TSLSuite.exe : fatal error LNK1120: 19 unresolved externals
jom 1.0.6 - empower your cores
command failed with exit code 1120
command failed with exit code 2
11:33:58: The process "C:\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
Error while building project TSLSuite (target: Desktop)
When executing build step 'Make'
I've been getting many frustrating problems with Qt...I can never seem to find out how to properly add libraries, and every new thing I try takes forever to get working...am I missing something??
Please answer the following questions:
What is wrong with my current code, and how do I fix it?
What am I doing wrong with Qt? Why is it so hard for me to use new libraries and classes?
In your .pro file you need to add the network module:
QT += core gui network

VC++, linking error with wxWidgets, x64

I'm compiling a VC++ 10 application on Windows 7 x64 with wxWidgets 2.8. And this is the errors I have. The code is generated using wxFormBuilder.
Update: I try to run it on 32-bit machine as well, still having the same problem.
I have no idea which wxwidgets libraries I'm missing out, or what settings did I do it wrong. Tried both in Debug and Release mode.
I'd really appreciate if someone could point to some hints! Been looking at this problem for a while.
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>ControlDialog.obj : error LNK2019: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B) referenced in function "public: void __cdecl ControlDialog::loadFile(class std::basic_string,class std::allocator >)" (?loadFile#ControlDialog##QEAAXV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>MainFrame.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
1>MainFrame.obj : error LNK2019: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB) referenced in function "public: __cdecl MainFrame::MainFrame(class wxWindow *,class UIApp *)" (??0MainFrame##QEAA#PEAVwxWindow##PEAVUIApp###Z)
1>UIApp.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>VISUI.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>Helper.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "public: static unsigned __int64 const wxStringBase::npos" (?npos#wxStringBase##2_KB)
1>MainFrame.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>UIApp.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>VISUI.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>ConsoleDlg.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>Helper.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "char const * const wxEmptyString" (?wxEmptyString##3PEBDEB)
1>ControlDialog.obj : error LNK2001: unresolved external symbol "class wxMBConvUTF8 & wxConvUTF8" (?wxConvUTF8##3AEAVwxMBConvUTF8##EA)
1>Helper.obj : error LNK2001: unresolved external symbol "class wxMBConvUTF8 & wxConvUTF8" (?wxConvUTF8##3AEAVwxMBConvUTF8##EA)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxGLCanvas::sm_eventTable" (?sm_eventTable#wxGLCanvas##1UwxEventTable##B)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "char const * const wxFrameNameStr" (?wxFrameNameStr##3QBDB)
1>VISUI.obj : error LNK2001: unresolved external symbol "char const * const wxFrameNameStr" (?wxFrameNameStr##3QBDB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxPalette wxNullPalette" (?wxNullPalette##3VwxPalette##A)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "class wxCursor wxNullCursor" (?wxNullCursor##3VwxCursor##A)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_NULL" (?wxEVT_NULL##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_ERASE_BACKGROUND" (?wxEVT_ERASE_BACKGROUND##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_PAINT" (?wxEVT_PAINT##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_SIZE" (?wxEVT_SIZE##3HB)
1>WxWidgetsWindow.obj : error LNK2001: unresolved external symbol "int const wxEVT_IDLE" (?wxEVT_IDLE##3HB)
The libraries I'm linking against (64-bit wxwidgets libraries)
wxbase28.lib
wxmsw28_core.lib
wxmsw28_richtext.lib
wxmsw28_html.lib
wxmsw28_gl.lib
wxmsw28_adv.lib
comctl32.lib
Rpcrt4.lib
My compiling settings:
Treat Wchat_t as built in type: Yes
Multi-threaded Debug DLL
I found the solution to my own problem. Just post here in case anyone faces it.
It's not about x64 or x32, neither about wxWidgets. I just need to add these 2 lines in header (before #include <wx/wx.h>)
#define __WXMSW__
#define WXUSINGDLL
How did you build wxWidgets? My understanding is that you will have to change the Visual Studio projects files distributed with wxWidgets, so that it builds in 64-bit mode. Unless you are targeting 32-bit mode. So make sure that you are targeting the same architecture with both your application and wxWidgets (i.e. both should be either 32 or 64 bit).
Also, last I looked, wxWidgets 2.8 doesn't support x64, you will need to upgrade to wxWidgets 2.9 if you want to target x64.
You can also check out the following link: http://wiki.wxwidgets.org/Supporting_x64_and_Win32_within_one_solution
1>WelcomeDlg.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition##3VwxPoint##B)
This is an extremely strange external symbol. What is 'class' doing there - it is a C++ keyword. What are all the spaces doing?
My guess is that something horrible happened during compilation. Are you certain you even submitted your source code to a C++ compiler?
Had the same problems on MSVC 2019 as described in the question when try to build from precompiled binaries downloaded from site.
When I compiled from source from ...\build\msw\wx_vc12.sln with "Release" option (NOT "Release DLL", but "Release") and get "vc_x64_lib" folder everything works. In my case no needs specify #define __WXMSW__ and #define WXUSINGDLL, just check you build with Multi-threaded DLL (/MD)