Qt Socket problems - c++

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

Related

Qt 5.12.2 + CMake 3.21.1 + Visual Studio 2019 / 2022: linker problems

I have a project in which cmake generation passes correctly. But, when I try to build I receive 2800+ error with LNK2001 or LNK2019 code: inresolved external symbol. Some examples:
C:\Projects\client\out\build\x32-Debug\worker.lib(worker.cpp.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: double __thiscall QRectF::left(void)const " (__imp_?left#QRectF##QBENXZ) referenced in function "public: class QStringList __thiscall Worker::readData(struct MinImg const &)" (?readBarcodes#Worker##QAE?AVQStringList##ABUMinImg###Z)
C:\Projects\client\out\build\x32-Debug\worker.lib(worker.cpp.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: double __thiscall QRectF::top(void)const " (__imp_?top#QRectF##QBENXZ) referenced in function "public: class QStringList __thiscall Worker::readData(struct MinImg const &)" (?readBarcodes#Worker##QAE?AVQStringList##ABUMinImg###Z)
C:\Projects\client\out\build\x32-Debug\worker.lib(worker.cpp.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: double __thiscall QRectF::width(void)const " (__imp_?width#QRectF##QBENXZ) referenced in function "public: class QStringList __thiscall Worker::readData(struct MinImg const &)" (?readBarcodes#Worker##QAE?AVQStringList##ABUMinImg###Z)
C:\Projects\client\out\build\x32-Debug\worker.lib(worker.cpp.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: double __thiscall QRectF::height(void)const " (__imp_?height#QRectF##QBENXZ) referenced in function "public: class QStringList __thiscall Worker::readData(struct MinImg const &)" (?readBarcodes#Worker##QAE?AVQStringList##ABUMinImg###Z)
The same applies to every class which is contained by Qt. In other words, compiler doesn't see Qt directory ('C:\Qt\5.15.2\msvc2019_64'). Toolset is set to msvc2019_x86. I tried the decision from here and also tried to add
set(CMAKE_PREFIX_PATH "C:\\Qt\\5.15.2\\msvc2019_64\\")
to the root CMakeLists.txt file - nothing helps.
I tried both VS 2019 and 2022.
firstely tap this line in your CMD
set QTDIR "C:\Qt\5.15.2\msvc2019_64\bin"
secondely make this line in your cmakelistes.txt
set(CMAKE_PREFIX_PATH $ENV{QTDIR})

Pixar USD LNK2019: unresolved external symbol

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.

Qt 5.5.0 cannot find OpenGL functions

I have a Qt project that uses OpenGL and compiles fine with Qt 5.4.0. Today I upgraded my Qt to 5.5.0 and my project stopped compiling. It throws a lot of unresolved external symbol errors as you can see here:
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\UI.exe #C:\Users\DWilches\AppData\Local\Temp\UI.exe.376.5500.jom
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glBegin#4 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::paintGL(void)" (?paintGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glClearDepth#8 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::initializeGL(void)" (?initializeGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glColor3f#12 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::paintGL(void)" (?paintGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glColor4f#16 referenced in function "private: void __thiscall UIOpenGLVisualizer::PaintScene(void)" (?PaintScene#UIOpenGLVisualizer##AAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glEnd#0 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::paintGL(void)" (?paintGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glFrustum#48 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::paintGL(void)" (?paintGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glInitNames#0 referenced in function "public: void __thiscall UIOpenGLVisualizer::NewSelectionPerformed(void)" (?NewSelectionPerformed#UIOpenGLVisualizer##QAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glLineStipple#8 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::initializeGL(void)" (?initializeGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glLoadIdentity#0 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::initializeGL(void)" (?initializeGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glLoadName#4 referenced in function "public: void __thiscall UIOpenGLVisualizer::NewSelectionPerformed(void)" (?NewSelectionPerformed#UIOpenGLVisualizer##QAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glMatrixMode#4 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::initializeGL(void)" (?initializeGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glOrtho#48 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::initializeGL(void)" (?initializeGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glPointSize#4 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::initializeGL(void)" (?initializeGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glPushName#4 referenced in function "public: void __thiscall UIOpenGLVisualizer::NewSelectionPerformed(void)" (?NewSelectionPerformed#UIOpenGLVisualizer##QAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glRenderMode#4 referenced in function "public: void __thiscall UIOpenGLVisualizer::NewSelectionPerformed(void)" (?NewSelectionPerformed#UIOpenGLVisualizer##QAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glRotatef#16 referenced in function "public: void __thiscall UIOpenGLVisualizer::NewSelectionPerformed(void)" (?NewSelectionPerformed#UIOpenGLVisualizer##QAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glScalef#12 referenced in function "public: void __thiscall UIOpenGLVisualizer::NewSelectionPerformed(void)" (?NewSelectionPerformed#UIOpenGLVisualizer##QAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glSelectBuffer#8 referenced in function "public: void __thiscall UIOpenGLVisualizer::NewSelectionPerformed(void)" (?NewSelectionPerformed#UIOpenGLVisualizer##QAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glTranslatef#12 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::paintGL(void)" (?paintGL#UIOpenGLVisualizer##UAEXXZ)
UIOpenGLVisualizer.obj : error LNK2019: unresolved external symbol __imp__glVertex3f#12 referenced in function "public: virtual void __thiscall UIOpenGLVisualizer::paintGL(void)" (?paintGL#UIOpenGLVisualizer##UAEXXZ)
debug\UI.exe : fatal error LNK1120: 20 unresolved externals
jom: C:\Users\DWilches\Desktop\3DIA\VolumeSelector\VVSIT\build-VVSIT-Desktop_Qt_5_5_0_MSVC2013_32bit-Debug\UI\Makefile.Debug [debug\UI.exe] Error 1120
jom: C:\Users\DWilches\Desktop\3DIA\VolumeSelector\VVSIT\build-VVSIT-Desktop_Qt_5_5_0_MSVC2013_32bit-Debug\UI\Makefile [debug] Error 2
21:35:43: The process "C:\ProgramFiles\Qt\Qt5.5.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
Error while building/deploying project VVSIT (kit: Desktop Qt 5.5.0 MSVC2013 32bit)
When executing step "Make"
I have not modified the .pro files between one and other version of Qt. And my .pro also has the line that says:
QT += opengl
What could be wrong ?
As exposed by #Ben-Voigt in the comments above, I had to explicitly instruct Qt to link against opengl32, so I added the following in my .pro:
LIBS += -lopengl32
I'm not sure why there is a change in behaviour in Qt 5.5.0 as that line was unnecessary in previous versions, but well, it solves the problem.

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.