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

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
}

Related

Project WARNING: *.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead

I'm trying to build a Qt Quick app for ios and I'm getting this compile error:
Project WARNING: *.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.
I'm following the instructions here:
http://doc.qt.io/qt-5/platform-notes-ios.html
I've got this in my deployment.pri file:
ios {
assets_catalogs.files = $$files($$PWD/ios/*.xcassets)
QMAKE_BUNDLE_DATA += assets_catalogs
}
If I swap out QMAKE_BUNDLE_DATA for QMAKE_ASSET_CATALOGS I get an ios build error:
:-1: error: Xcodebuild failed.
QMAKE_ASSET_CATALOGS also doesn't highlight in Qt Creator. I assume it's because the variable doesn't exist but I'm not sure. I've tried Qt v5.8 and v5.9.2 with no luck.
Any ideas?
I think there is no more "files" property :
QMAKE_ASSET_CATALOGS = $$PWD/ios/Images.xcassets
You may need to specify the prefix of the set :
QMAKE_ASSET_CATALOGS_APP_ICON = "AppIcon"
For me it doesn't work when run from Qt, I have to run from xcode.
Credits : https://appbus.wordpress.com/2017/10/06/ios-11-and-xcode-9-in-qt-5-9-x-projects/

error LSF: undefined symbol: _ZN3ajn15_RemoteEndpoint17 [alljoyn]

I have a trouble with LSF alljoyn 15.04, I build LSF in ubuntu 16.04 success but I cannot run any app. I'm receiving Notification whenever I run the ./lighting_controller_client_sample in service_framework-15.04/core/service_framework/build/linux/standard_core_library/lighting_controller_client/samples:
./lighting_controller_client_sample: symbol lookup error:
./lighting_controller_client_sample: undefined symbol:
_ZN3ajn15_RemoteEndpoint17PushMessageRouterERN3qcc10ManagedObjINS_8_MessageEEERm
How can I fix it?
Sounds like it can't find cpp libs (the .a and .so files).
In which case you need to define LD_LIBRARY_PATH.
For example, if you are building alljoyn with scons, then define the following environment variable before running your sample.
export LD_LIBRARY_PATH=/core/alljoyn/build/linux/x86_64/release/dist/cpp/lib
or
export LD_LIBRARY_PATH=/core/alljoyn/build/linux/x86_64/debug/dist/cpp/lib
That will at least allow it to find the alljoyn cpp lib files.

QT Creator: undefined reference to 'WinMain#16'

I am building a Unit-Test using this tutorial. However, when compiling my code I get these two errors:
undefined reference to 'WinMain#16'.
collect2: ld returned 1 exit status.
why is this happening?
Did you create a main function where you create a qapplication? There's a good example here
You can also get that error when you're creating a DOS executable instead of a Windows GUI executable. It's looking for winmain() not main(),

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