Qt: Building quazip/zlib Library error - qt

I am statically building the quazip library as mentioned in the following post: linking QuaZip with Qt 4.8.0 into project
I get these error when I build the project:
/QtSDK/QtSources/4.8.0/src/3rdparty/zlib/zconf.h:373:6: error: "_LARGEFILE64_SOURCE" is not defined
In file included from ../../../quazip-0.4.4/quazip/zip.h:56,
from ../../../quazip-0.4.4/quazip/quazip.h:31,
from ../../../quazip-0.4.4/quazip/quazipfile.h:30,
from ../../../quazip-0.4.4/quazip/quazipfile.cpp:24:
/QtSDK/QtSources/4.8.0/src/3rdparty/zlib/zlib.h:1583:32: error: "_FILE_OFFSET_BITS" is not defined
cc1plus: warnings being treated as errors
Are these known errors in zlib library? I am using zlib library in Qt 4.8.0

That would be a bug in your compiler. I can't tell what version of zlib you're using, and your compiler does not show the offending line in the error message, so I can't tell exactly what the line contains. However I suspect that these are lines that have an #if directive with the noted symbol in the expression. Per the C standard, a symbol that is not defined is given a null value (no characters replace it) in an expression in an #if statement. Instead your compiler is erroneously issuing an error.

Related

Deploy Qt Design Studio Project for Webassembly

I am using Qt 6.3.2 and im on a M1 Mac.
I am trying to build a Qt Design Studio Project for webassembly but I have trouble to install the Designer Components for Webassembly.
To use a Design Studio Project, you have to install the Designer Components to your Installation, which I did like stated in the documentation:Adding Qt Quick Designer Components to Qt Installations.
This works fine when I build it for Mac but I cant get it to work with WASM. Do I need to build the components in a specific way for em++?
When I use the components like stated in the docs I get the following error message:
em++: warning: unrecognized file type: `/Users/marius/Qt/6.3.2/wasm_32/./qml/QtQuick/Studio/Effects/libquickstudioeffectsplugin.dylib`. Mapping to `-lquickstudioeffectsplugin` and hoping for the best [-Wmap-unrecognized-libraries]
em++: warning: unrecognized file type: `/Users/marius/Qt/6.3.2/wasm_32/./qml/QtQuick/Studio/Application/libquickstudioapplicationplugin.dylib`. Mapping to `-lquickstudioapplicationplugin` and hoping for the best [-Wmap-unrecognized-libraries]
em++: warning: unrecognized file type: `/Users/marius/Qt/6.3.2/wasm_32/./qml/QtQuick/Studio/EventSimulator/libquickstudioeventsimulatorplugin.dylib`. Mapping to `-lquickstudioeventsimulatorplugin` and hoping for the best [-Wmap-unrecognized-libraries]
em++: warning: unrecognized file type: `/Users/marius/Qt/6.3.2/wasm_32/./qml/QtQuick/Studio/EventSystem/libquickstudioeventsystemplugin.dylib`. Mapping to `-lquickstudioeventsystemplugin` and hoping for the best [-Wmap-unrecognized-libraries]
wasm-ld: error: unable to find library -lquickstudioeffectsplugin
wasm-ld: error: unable to find library -lquickstudioapplicationplugin
wasm-ld: error: unable to find library -lquickstudioeventsimulatorplugin
wasm-ld: error: unable to find library -lquickstudioeventsystemplugin
em++: error: '/Users/marius/Documents/Git/emsdk/upstream/bin/wasm-ld #/var/folders/k3/prb53mjs50sf220pb_trz4fc0000gn/T/emscripten_7udnbcap.rsp.utf-8' failed (returned 1)
ninja: build stopped: subcommand failed.
I tried to build the components for other architectures or as a static library.

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
}

Poco / zlib: error LNK2019 unresolved external "_gzopen"

I am trying to use zlib functions while working with poco c++ library. Linking to the zlib library directly does not work, because poco links to it also and I get several duplicates while linking. So I removed zlib.lib from my libraries list and used the poco version only.
Because zlib.h is part of poco, compiling works perfectly, but linking now results in the following error
error LNK2019 unresolved external "_gzopen"
So I can switch between duplicate and unresolved. Who can help me out?
On windows, defining ZLIB_DLL should force export of native zlib interface. Optionally, Poco InflatingStream and DeflatingStream wrap zlib functionality. A word of warning: these are std streams derivatives and there may be a performance penalty.

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?

Qmake build and gcc includes

I am working with Qt and kinda new to it. I want to build a Qt application and created devprog.pro file. However, after executing qmake and make I get the error
c:\qt473\include\qtcore../../src/corelib/global/qglobal.h(45)
: fatal error C10 83: Cannot open
include file: 'stddef.h': No such file
or directory
So I specified the gcc 4.4.1 include location and the error messages (amongst others) I get is:
c:\codeblocks\MinGW\lib\gcc\mingw32\4.4.1\include\stddef.h(211)
: error C2371: ' size_t' :
redefinition; different basic types
predefined C++ types (compiler internal)(19) : see declaration of
'size_ t'
C:\CodeBlocks\MinGW\include\string.h(126)
: error C2143: syntax error : missing
';' before '*'
C:\CodeBlocks\MinGW\include\string.h(126)
: error C4430: missing type specifier
- int assumed. Note: C++ does not support default-int
My question is:
1. How can resolve such error problems as I've scratched my hair off trying to solve this.
2. Is there a way to make automatically let qmake detect your main gcc mingw location without having to set it for each project during qmake execution?

Resources