I have a static build for both Qt and OpenCV. When I try to make a static application in QtCreator:
g++ -static -static-libgcc -Wl,-s -Wl,-subsystem,windows -mthreads -o release\Test.exe release/main.o release/mainview.o release/opencvcam.o release/thing.o release/test_plugin_import.o release/moc_mainview.o release/moc_opencvcam.o -lmingw32 -LC:/Qt/Static/5.3.1/lib -lqtmain -LC:/Programs/Opencv_static_build/lib -LC:/Programs/Opencv_static_build/3rdparty/lib -lzlib -llibjasper -llibjpeg -llibpng -lopencv_core249 -lopencv_highgui249 -lopencv_imgproc249 -LC:/Qt/Static/5.3.1/plugins/accessible -lqtaccessiblewidgets -lQt5Widgets -LC:/Qt/Static/5.3.1/plugins/platforms -lqwindows -lwinspool -lshlwapi -lQt5PlatformSupport -LC:/Qt/Static/5.3.1/plugins/imageformats -lqdds -lqicns -lqico -lqjp2 -lqmng -lqtga -lqtiff -lqwbmp -lqwebp -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm -lglu32 -lopengl32 -lgdi32 -lQt5Core -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
I get the following error:
C:/Programs/Opencv_static_build/lib\libopencv_core249.a(persistence.cpp.obj):persistence.cpp:(.text$_ZL12icvCloseFileP13CvFileStorage+0x4e): undefined reference to gzclose'
C:/Programs/Opencv_static_build/lib\libopencv_core249.a(persistence.cpp.obj):persistence.cpp:(.text$_ZL6icvEofP13CvFileStorage+0x43): undefined reference to
gzeof'
I tried reordering the third party libs, but I don't know how they need to be ordered in the first place.
My goal here is to build standalone app with Qt and OpenCV. However, if that's not possible given my current knowledge, I would need to find another way. If I copy all the DLLs into the .exe direcory, is this going to work on another Windows machine? I don't have another Windows PC here, so don't know how to test right now.
Thank you!