Can't build using 3rd party libraries
RingAndReed last edited by RingAndReed
I have a problem accessing a 3rd party library (SMS) in QT Creator.
I'm on Windows 10, 64 bit
Qt Creator 4.2.1 - Based on Qt 5.8.0 (MSVC 2015, 32 bit)
Using Visual Studio 2015 (Community and Enterprise) with update 3
In Visual Studio, I was able to correct the problem using Windows Environment Variables and by setting Character Set to Unicode. But I would really prefer to use Qt Creator for an IDE.
In Qt Creator, the simplest code referring to SMS produces the build error below. There are no *d.dll or *d.lib files (no debugging versions) but that does not seem to prevent debugging my own code in Visual Studio. I have tried release-mode building in Qt Creator, but that did not help. I have even tried modifying the *.pro file with an absolute path - no go.
Can anyone tell me how to buildling with these 3rd party libraries?
The build error:
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='22.214.171.124' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:release\legereModeler.exe @C:\Users\ROBIN_~1\AppData\Local\Temp\legereModeler.exe.4552.1922.jom surfacesmoother.obj : error LNK2019: unresolved external symbol "void __cdecl iwos_WriteBuffer(char const *,char const *,char const *)" (?iwos_WriteBuffer@@YAXPEBD00@Z) referenced in function "public: virtual void __cdecl IwTArray<class IwVector3d>::Dump(void)const " (?Dump@?$IwTArray@VIwVector3d@@@@UEBAXXZ) surfacesmoother.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl IwObject::Dump(char *)const " (?Dump@IwObject@@UEBAXPEAD@Z) release\legereModeler.exe : fatal error LNK1120: 2 unresolved externals jom: E:\sandbox\build-legereModeler-Desktop_Qt_5_8_0_MSVC2015_64bit-Release\Makefile.Release [release\legereModeler.exe] Error 1120 jom: E:\sandbox\build-legereModeler-Desktop_Qt_5_8_0_MSVC2015_64bit-Release\Makefile [release] Error 2 14:58:30: The process "C:\Qt\Qt5.8.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
My *.pro file:
QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = legereModeler TEMPLATE = app DEFINES += QT_DEPRECATED_WARNINGS SOURCES += main.cpp\ control/surfacesmoother.cpp \ display/mainwindow.cpp \ handlers/mainwindowhandlers.cpp \ model/fakedata.cpp \ utils/coordinatesmanager.cpp HEADERS += control/surfacesmoother.h \ display/mainwindow.h \ handlers/mainwindowhandlers.h \ model/fakedata.h \ utils/coordinatesmanager.h \ GeneratedFiles/ui_mainwindow.h FORMS += mainwindow.ui LIBS += -L$$PWD/../SMS/ -lNLib #LIBS += -LC:\sandbox\SMS -lNLib #LIBS += -L$$PWD/../SMS/ -lNLibd LIBS += -L$$PWD/../SMS/ -lNMTLib #LIBS += -LC:\sandbox\SMS -lNMTLib #LIBS += -L$$PWD/../SMS/ -lNMTLibd INCLUDEPATH += $$PWD/../SMS DEPENDPATH += $$PWD/../SMS
Do you mean you are building your Qt project with Visual Studio successfully and only modify the source charset option ?
RingAndReed last edited by
@SGaist Yes, that's right.
Then you should be able to do that through QMAKE_CXXFLAGS
RingAndReed last edited by
Eeeeg, looks really cool (just looked it up) .... but I'm a Qt newbie ..... I was hoping that importing the *.lib and *.dll files should "just make it work". (As it does in MSVS.)
So I found this: http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-cxxflags but I haven't clue 1 where to start learning to use them..... could you point me in the right direction?
Add it to your .pro file and then grab from Visual Studio the switch used to select the character.
QMAKE_CXXFLAGS += whatever_you_found