Qt + Zlib => error LNK2005: _deflate_copyright already defined in QtCored.lib(deflate.obj) zlibstat.lib - qt

When I link my application I receive the following message:
error LNK2005: _deflate_copyright already defined in QtCored.lib(deflate.obj) zlibstat.lib
I'm not sure of the problem, but... I use QT and ZLib. Both are "static libraries". The problem is that the QTCore.lib contains ZLib too!
Project Qt: contains its own version on ZLib.
Project GenericLib: use an external ZLib.lib (cannot be linked to Qt).
Project main: use Qt + Generic lib.
As I say, I'm not sure that it is the problem. But, anyway, if someone has an idea to help me?
Thanks for your help.

Related

qt5 and usblib in win7 (mingw32) linker produces undefined references to `_imp__SetupDiGetClassDevsA#16'

I'm using qt5.5 in linux and win7 (mingw32) ... in linux it works (i had to build new usblibs for compatibility reasons)
in windows using this library
/usr/local/.../code-qt/libusb-1.0.19-rc1-win/MinGW32/static/
i get the following errors and a few more, all with some
"_imp__SetupDixxxxxxx" being undefined
since the libusb build in windows seems quite more complicated, i was unable to figure out how to do it
at this point i have no clue what is wrong and any help is highly appreciated
i have no problems rebuilding the lib with ming32w inside or outside of qt5 creator or any other way, but i would need to have a few steps described on how to proceed.
cheers EinHexenMeister
E:\code-qt\qtHidTest\HidTest\windows\hid.c:289: error: undefined reference to `_imp__SetupDiGetClassDevsA#16'
E:\code-qt\qtHidTest\HidTest\windows\hid.c:298: error: undefined reference to `_imp__SetupDiEnumDeviceInterfaces#20'
E:\code-qt\qtHidTest\HidTest\windows\hid.c:491: error: undefined reference to `_imp__SetupDiDestroyDeviceInfoList#4'
E:\code-qt\qtHidTest\HidTest\windows\hid.c:313: error: undefined reference to `_imp__SetupDiGetDeviceInterfaceDetailA#24'
E:\code-qt\qtHidTest\HidTest\windows\hid.c:347: error: undefined reference to `_imp__SetupDiEnumDeviceInfo#12'
You need to link additional libraries for windows, add in your .pro file:
win32 {
LIBS += -lhid -lsetupapi
}

compilation issue : libvlc exception t is missing

I'm trying to mix Qt and libVLC, I've downloaded libs, tried some tutorials, but I always stop on the same error and I can't find any solution in Google...
Here's the compilation output
error: unknown type name 'libvlc_exception_t'; did you mean 'libvlc_event_t'?
I'm running MacOS 10.8.4
EDIT : the libvlc_exception_t is not even documented on LibVLC Doc
That's why :
doc/ChangeLog-2010: The libvlc_exceptions have been removed from libvlc.

Force order of linking libraries in Qt Creator

I'm trying to use a 3rd party driver from an app in Qt Creator. This app has to be included as a static library. It won't compile without the /MT flags. After much heartache, I've gotten it down to two linker errors:
msvcrtd.lib(ti_inst.obj):-1: error: LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info##AAE#ABV0##Z) already defined in LIBCMTD.lib(typinfo.obj)
msvcrtd.lib(ti_inst.obj):-1: error: LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info##AAEAAV0#ABV0##Z) already defined in LIBCMTD.lib(typinfo.obj)
I think this problem is described here. If that's the case, then I suppose I need to know how to force Qt Creator to link these system libraries in a specific order, when I haven't even included them explicitly in the .pro file in the first place. If someone could tell me how to do that, that'd be great. If, however, this isn't the same problem described on the MS page, an explanation of what I'm really doing wrong, would be even better.
Just to get this marked as answered, I'll quote kanders84152: "Never mind. I was linking against the wrong msvc library. Supposed to use msvcmrt.lib and not msvcurt.lib nor msvcprt.lib. It seems to work now. Thanks, all."

Build error - variable environment not set correctly

I'm trying to build an opensource code on windows.
I get the error:
Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as D;/Qt/4.8.4/lib
Warning: D**;**/Qt/4.8.4/lib does NOT exist, Qt must NOT be installed correctly.
CMake Error at /usr/share/cmake-2.6.4/Modules/FindQt4.cmake:640 (MESSAGE):
Could NOT find QtCore header
(this is only a part of the error message)
I tried to re-install Qt, didn't work.
I tried to change QT_INSTALL_LIBS to be D:/Qt/4.8.4/lib (and not D:/Qt/4.8.4/lib) in my computer -> properties -> advanced - > environment variables but that didn't seem to change a thing.
I have no idea what to do next. Does anyone know what I should do fix it?

Problem statically linking to Botan on Windows using MSVC

I am trying to statically link a Qt library I am building to Botan using MSVC on Windows and am receiving the following error.
..\..\3rdparty\temp\botan-msvc\build\include\botan/secmem.h(129) : error C2589: '(' : illegal token on right side of '::'
..\..\3rdparty\temp\botan-msvc\build\include\botan/secmem.h(128) : while compiling class template member function 'void Botan::MemoryRegion<T>::copy(const T [],size_t)'
with
[
T=Botan::byte
]
..\..\3rdparty\temp\botan-msvc\build\include\botan/buf_comp.h(41) : see reference to class template instantiation 'Botan::MemoryRegion<T>' being compiled
with
[
T=Botan::byte
]
..\..\3rdparty\temp\botan-msvc\build\include\botan/secmem.h(129) : error C2059: syntax error : '::'
This does not occur with MinGW. It also occurs when I comment out all Botan-related code. What does this mean and how can I solve it - also why does it not occur with MinGW?
I was able to figure out the issue with help from Jack Lloyd's comment. Apparently something that's included through one path or another #defined "min". I just undefined it and my library compiles and links perfectly. Thanks Jack!

Resources