This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Problems at using mingw-32 64bit compile under Windows 10.

Tags: None
(comma "," separated)
longkimari
Registered Member
Posts
2
Karma
0
hi,

Everything seems to be OK when I followed the guidance :https://community.kde.org/Marble/WindowsCompiling
But at the step : mingw32-make, it shows those errors below:
-------------------------------------------------------------------------
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x2349): undefined reference to `inflateInit2_'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x23f9): undefined reference to `inflate'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x240c): undefined reference to `inflateEnd'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x2492): undefined reference to `inflateEnd'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x2794): undefined reference to `deflateInit2_'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x27f5): undefined reference to `crc32'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x2810): undefined reference to `crc32'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x2cac): undefined reference to `deflate'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x2cbf): undefined reference to `deflateEnd'
CMakeFiles\marblewidget.dir/objects.a(MarbleZip.cpp.obj):MarbleZip.cpp:(.text+0x2d9b): undefined reference to `deflateEnd'
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [src\lib\marble\CMakeFiles\marblewidget.dir\build.make:10792: src/lib/marble/libmarblewidget-qt5.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2949: src/lib/marble/CMakeFiles/marblewidget.dir/all] Error 2
mingw32-make: *** [Makefile:162: all] Error 2
----------------------------------------------------------------------------
And there were some options notices like :
---------------------------------------------------------------------------
-- The following OPTIONAL packages have not been found:

* Qt5WebEngine (required version >= 5.7.0)
* Qt5WebEngineWidgets (required version >= 5.7.0)
* Phonon4Qt5, Qt-based audio library, <https://phonon.kde.org/>
Support for playback of soundcue elements
Voice navigation (sound or human speakers)
* ECM (required version >= 1.7.0)
----------------------------------------------------------------------------
I'm using QT5.14.0/Windows10, and wann to complie marble in 64bits.

What should I do ?
User avatar
tackat
KDE Developer
Posts
131
Karma
0
OS
Happy New Year 2020,

I actually just compiled Marble on mingw32 64bit just recently, so it should compile through if everything is set up properly.
However this might be related to a special situation with regard to the presence of the zlib library which Marble uses for handling zip-files (like KMZ-files).

If the system has a version of zlib installed already (before Marble is compiled) the the system zlib is used. When not found, a Marble internal zlib is used.
I suspect that on Windows 10 usually Marble would use its own zlib implementation (located inside src/3rdparty) and would link properly.
Could it be that you have a version of zlib installed on your Windows OS already (which Marble is using instead)?

Note that there is also a cmake option WITH_ZLIB which is ON by default. You could set it to OFF to check if it compiles. That however would make you lose the following features: KMZ-support, osm.zip-support and Newstuff-support. Depending on your usecase that might not be an issue though :-)

Please give feedback if you find a fix or a workaround :-)

Best regards
Torsten
longkimari
Registered Member
Posts
2
Karma
0
Happy New Year 2020,
I checked the problem on stackoverflow :
Modify this:
sources\src\lib\marble\CMakeLists.txt
target_link_libraries(marblewidget LINK_PRIVATE astro)
-> target_link_libraries(marblewidget LINK_PRIVATE astro z)
Then Cmake again and mingw32-make -j2
The errors in yesterday that had passed.
User avatar
tackat
KDE Developer
Posts
131
Karma
0
OS
Hi longkimari,

thanks for your feedback. The linking should actually happen in the existing code in the next line:

# link with libastro
target_link_libraries(marblewidget LINK_PRIVATE astro)

# link against zlib
target_link_libraries(marblewidget LINK_PRIVATE ${ZLIB_LIBRARIES})

In the case of the static zlib-version being used the environment variable $(ZLIB_LIBRARIES) should equal "zlibstatic".

src/CMakeLists.txt: set(ZLIB_LIBRARIES zlibstatic)

Would linking also work for you if you change

src/3rdparty/zlib/CMakeLists.txt: set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME z)

to

src/3rdparty/zlib/CMakeLists.txt: set_target_properties(zlibstatic PROPERTIES OUTPUT_NAME zlibstatic)

? Could you revert your own workaround and apply my suggestion instead in your code base? If that works for you I'd like to fix this in the sources accordingly ...

Best regards

Torsten


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]