PDA

View Full Version : Building with 3rd party library



RingAndReed
26th August 2017, 20:59
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?
Thanks!

Build error:

link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:release\legereModeler.exe @C:\Users\ROBIN_~1\AppData\Local\Temp\legereModele r.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
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

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

wysota
28th August 2017, 10:46
Please check the compiler invocation if it sets a proper path to search for your library. Also check if the libraries you link against do contain the missing symbols.

RingAndReed
29th August 2017, 12:06
Thanks for your reply,
Where can I find the compiler invocation?
.... like I wrote: the project works fine in Visual Studio, so my symbols do exist ... I would really prefer to use QT Creator.

wysota
29th August 2017, 14:31
Where can I find the compiler invocation?

In the "compiler output" tab (on the bottom) in Creator.