Error building tools with QT(stlport)

Added by nestath almost 6 years ago

Anybody knows how to solve the conflict between zLib and QT when building some Object Viewer QT's plugins. I'm getting this logs trying to build some projects:

Error 41 error LNK2005: _gzread already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\translation_manager\zlib.lib(gzread.obj)
Error 48 error LNK2005: _gzread already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\mission_compiler\zlib.lib(gzread.obj)
Error 58 error LNK2005: _gzread already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\georges_editor\zlib.lib(gzread.obj)
Error 80 error LNK2005: _gzread already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\object_viewer\zlib.lib(gzread.obj)
Error 225 error LNK2005: _gzread already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\ryzom\tools\leveldesign\georges_editor_qt\src\zlib.lib(gzread.obj)
Error 42 error LNK2005: _gzopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\translation_manager\zlib.lib(gzlib.obj)
Error 49 error LNK2005: _gzopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\mission_compiler\zlib.lib(gzlib.obj)
Error 59 error LNK2005: _gzopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\georges_editor\zlib.lib(gzlib.obj)
Error 81 error LNK2005: _gzopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\object_viewer\zlib.lib(gzlib.obj)
Error 226 error LNK2005: _gzopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\ryzom\tools\leveldesign\georges_editor_qt\src\zlib.lib(gzlib.obj)
Error 43 error LNK2005: _gzdopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\translation_manager\zlib.lib(gzlib.obj)
Error 50 error LNK2005: _gzdopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\mission_compiler\zlib.lib(gzlib.obj)
Error 60 error LNK2005: _gzdopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\georges_editor\zlib.lib(gzlib.obj)
Error 82 error LNK2005: _gzdopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\nel\tools\3d\object_viewer_qt\src\plugins\object_viewer\zlib.lib(gzlib.obj)
Error 227 error LNK2005: _gzdopen already defined in QtCore4.lib(QtCore4.dll) F:\...\code\build\ryzom\tools\leveldesign\georges_editor_qt\src\zlib.lib(gzlib.obj)
Error 44 error LNK1169: one or more multiply defined symbols found F:\...\code\build\bin\Release\ovqt_plugin_translation_manager_r.dll 1
Error 51 error LNK1169: one or more multiply defined symbols found F:\...\code\build\bin\Release\ovqt_plugin_mission_compiler_r.dll 1
Error 61 error LNK1169: one or more multiply defined symbols found F:\...\code\build\bin\Release\ovqt_plugin_georges_editor_r.dll
Error 83 error LNK1169: one or more multiply defined symbols found F:\...\code\build\bin\Release\ovqt_plugin_object_viewer_r.dll 1
Error 228 error LNK1169: one or more multiply defined symbols found F:\...\code\build\bin\Release\georges_editor_qt.exe 1

I had taking a look on links and cMake options but couldn't figure out the problem. If I take off one of both links it crashes in several other ways. I also thought about using a QT compiled without stlport it isn't work too. Now I return to use the QT compiled with stlport available on sourceforge, cause I it takes a huge time to rebuild, and can't go through this problems.

Is it necessary to rebuild QT to solve it or is there some other solution that. I can't see it with my poor knowledge about c++/ryzom architecture =/


Replies (16)

RE: Error building tools with QT(stlport) - Added by kervala almost 6 years ago

I don't understand why it tries to use "zlib.lib" in each plugins directory...

Is it exist really on your machine ?

As you surely noticed, it only says you can't link 2 different static compiled zlib into the same program.

Qt is using zlib in its dlls but it shouldn't expose its symbols, Ryzom is only using it in client... So what could be the zlib conflict ?

Perhaps libcurl or libxml being compiled with it...

On my PC, I don't have this problem because I compiled Qt to use zlib1.dll.

I'll try to check with official Qt packages.

Edit: I fixed the need to use Qt with STLport, so you should be able to use any Qt versions with Ryzom Core.

RE: Error building tools with QT(stlport) - Added by nestath almost 6 years ago

So, as I told I'm using Qt Stlport 4.7.4 Lib that's available from Molator's downloads here on wiki. Maybe it's causing this problems, I'll try to download a newest QT lib and try again. Anyway I'm using trunk source that you commited with e7d6533 - Fixed: MFC tools compilation with STLport on MVS2010.

RE: Error building tools with QT(stlport) - Added by kervala almost 6 years ago

Ok, I tried with official Qt version from QtSDK and manually compiled versions and it works fine so I suspect the problem is coming from Molator version.

Molator> Could you try if you have the same issue please ?

RE: Error building tools with QT(stlport) - Added by nestath almost 6 years ago

It was QT lib.

Worked pretty well with newest QT 4.8.1 on VS2010.

Thank you again Kervala.

RE: [SOLVED] Error building tools with QT(stlport) - Added by nestath almost 6 years ago

Good Lord!
For some hellish reason, when I rebuilded the solution I got:

Error 23 error LNK2005: _inflateReset already defined in QtCore4.lib(QtCore4.dll) R:\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)
Error 24 error LNK2005: _inflateInit2_ already defined in QtCore4.lib(QtCore4.dll) R:\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)
Error 26 error LNK2005: _inflateEnd already defined in QtCore4.lib(QtCore4.dll) R:\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)
Error 25 error LNK2005: _inflate already defined in QtCore4.lib(QtCore4.dll) R:\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)
Error 30 error LNK1181: cannot open input file 'object_viewer_dll.lib' R:\build\nel\tools\3d\plugin_max\nel_export\LINK
Error 27 error LNK1169: one or more multiply defined symbols found F:\workspace\adventures\build\bin\Release\ovqt_plugin_example_r.dll
Error 29 error LNK1104: cannot open file 'F:\workspace\adventures\build\bin\Release\object_viewer_qt.exe' R:\build\nel\tools\3d\object_viewer_qt\src\LINK

What version of QT are you using Kervala? I already tried to clean and delete build, remaking with cMake and it always crashes the same way...

RE: Error building tools with QT(stlport) - Added by kervala almost 6 years ago

I suspect you modified some CMakeLists.txt and/or copied zlib.lib everywhere...

Do you have a R:\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib file ?

Because you shouldn't...

Please do a hg diff > F:\ryzom_core.diff and post it to confirm what I thought :)

RE: Error building tools with QT(stlport) - Added by nestath almost 6 years ago

I cant sincronize with repository here in my work. When I reach home I'll try it. But, here I downloaded .zip version of last trunk, don't sincronized by tortoise, so I delete all source folder and unzip it again, cMake build project again and building solution on VS2010 with QT 4.8.1 got same log errors.

I looked for zlib in R:\build\nel\tools\3d\object_viewer_qt\src\plugins\example\ and there isn't a zlib.lib

Making a rapid search in my project structure it was found just on R:\external\lib and R:\external\lib64, nor in source nor in build directories, it had a copy. (I'am using last external libs found in Official Binaries on windows binaries download page)

In cMake I activated all flags except for these:
GTK
WITH_LIBWWW_STATIC
WITH_NEL_CEGUI
WITH_STATIC_DRIVERS
WITH_STATIC_EXTERNAL

and snowball's ones

also, i tried with and without WITH_SYMBOL checked and same errors pops

I noticed that number of projects loaded on VS2010 varies with each try even with the exactly same flags set checked on cMake...

RE: Error building tools with QT(stlport) - Added by nestath almost 6 years ago

Using all static flags in same scenary described above it builded, apparently, correctly. I'm afraid to put a "solved" tag here cause it was ok last time and after a clean it brocke again... so, now I cleaned and rebuild with expected results 210 from 213 projects on solution was compiled with any errors and 3 skipeds that are install, packs and run_tests...

Thank you again for helping Kervala, in fact I think it was the wrong QT lib that was keeping me out of any solution on passed days, with your suggestion and a huge time wasted rebuilding with a lot of flag combinations I think I could undestand a little bit better the solution architecture.

Anyway I think it is not building ovqt editor correctly. It is generating a 23k executable that's crashing windows explorer when selected =/

RE: Error building tools with QT(stlport) - Added by Marlas over 5 years ago

so does this mean we are not supposed to: replace c:\qt\4.7.0 with https://docs.google.com/leaf?id=0B3LX3q7MsUEGMWFkN2FlYjEtMTAwOC00YmZjLWI5Y2ItNWQ4MDFmODJlMjdl like the wiki says? I am getting the same errors while using vs2010 ultimate version.

Thanks

RE: Error building tools with QT(stlport) - Added by kervala over 5 years ago

No, you can now use the official releases of Qt :)

RE: Error building tools with QT(stlport) - Added by Marlas over 5 years ago

ok thanks, still use 4.7.0 or the newest release?

RE: Error building tools with QT(stlport) - Added by nestath over 5 years ago

yet, I still can´t build OVQT with last official version of QT4 libs and every single build is resulting in a binary of OVQT editor with about 800kb thats impossible to delete, even trying forcing delete parameters. I could remove it from my hard disc only out of win7 from a linux OS forcing delete by command line... I aready give up trying to build OVQT cause I got no answares about this problem on building OVQT editor on windows 7 with QT4.8 official and VS2010...

RE: Error building tools with QT(stlport) - Added by kervala over 5 years ago

Hum did you disable the service "Application Experience" ? Because if yes, I had the same issue : I delete the .exe and it reappears some seconds later. You just need to reenable it to fix the issue :)

See http://www.retrocopy.com/blog/28/cant-delete-exe-files-in-vista--windows-7-solved.aspx

RE: Error building tools with QT(stlport) - Added by nestath over 5 years ago

nops... just tested and had same problem... and just object_viewer_qt.exe causes this issue on windows none other executables are unable to access ir delete and VS returns this log always I build:

error MSB6006: "mt.exe" exited with code 31.

error LNK2005: _inflateReset already defined in QtCore4.lib(QtCore4.dll) ...
\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)

error LNK2005: inflateInit2 already defined in QtCore4.lib(QtCore4.dll)
...\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)

error LNK2005: _inflateEnd already defined in QtCore4.lib(QtCore4.dll)
...\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)

error LNK2005: _inflate already defined in QtCore4.lib(QtCore4.dll)
...\build\nel\tools\3d\object_viewer_qt\src\plugins\example\zlib.lib(inflate.obj)

error LNK1169: one or more multiply defined symbols found
...\build\bin\Release\ovqt_plugin_example_r.dll

=/

RE: Error building tools with QT(stlport) - Added by kervala over 5 years ago

I'm really sorry but you're the only one to have this problem :(

The zlib error is related to something you setuped on your machine and that is not standard, so I can't help you if you don't find what is related to it.

If you said it worked at some point and not yet anymore, that's not related to Ryzom Core but your setup.

(1-16/16)