|
From: | Mark Brand |
Subject: | Re: [Mingw-cross-env-list] Undefined Reference errors when linking |
Date: | Thu, 23 Feb 2012 13:35:58 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120215 Firefox/10.0.2 SeaMonkey/2.7.2 |
Simon A. Eugster wrote:
On 02/20/2012 10:25 AM, Mark Brand wrote:My project now successfully compiles, linking fails however, withapproximately 42 billion error messages like the ones posted at the end.<snip>CMakeFiles/PhenoCam.dir/objects.a(exporterMainwindow.cpp.obj):exporterMainwindow.cpp:(.text+0xb1b):undefined reference to `__imp___ZN5QJson6ParserC1Ev'CMakeFiles/PhenoCam.dir/objects.a(exporterMainwindow.cpp.obj):exporterMainwindow.cpp:(.text+0xb40):undefined reference to `__imp___ZN5QJson6Parser5parseERK10QByteArrayPb'CMakeFiles/PhenoCam.dir/objects.a(exporterMainwindow.cpp.obj):exporterMainwindow.cpp:(.text+0x1379):undefined reference to `__imp___ZN5QJson6ParserD1Ev'CMakeFiles/PhenoCam.dir/objects.a(exporterMainwindow.cpp.obj):exporterMainwindow.cpp:(.text+0x1735):undefined reference to `__imp___ZN5QJson6ParserD1Ev'CMakeFiles/PhenoCam.dir/objects.a(selectVideoStep.cpp.obj):selectVideoStep.cpp:(.text+0x9e8):undefined reference to `__imp___ZN5QJson6ParserC1Ev'CMakeFiles/PhenoCam.dir/objects.a(selectVideoStep.cpp.obj):selectVideoStep.cpp:(.text+0xa16):undefined reference to `__imp___ZN5QJson6Parser5parseEP9QIODevicePb'CMakeFiles/PhenoCam.dir/objects.a(selectVideoStep.cpp.obj):selectVideoStep.cpp:(.text+0xc7c):undefined reference to `__imp___ZN5QJson6ParserD1Ev'Hi Simon, You might find some clues here:http://stackoverflow.com/questions/5159353/how-can-i-get-rid-of-the-imp-prefix-in-the-linker-in-vcSomebody who knows more about cmake and qjson might be able to give more specific advice. MarkThanks for the link! If I understand correctly the json .lib is generated for a .dll?
No, the problem is with the object files you are building. They wrongly have the "import" prefix on the symbol names.
Which is controlled by cross-env? Or what could I do? Is it a mistake in my CMake files?
The prefixing in qjson_export.h is sensitive to QJSON_STATIC. You should probably have a look to see how it works.
The solution is probably to define QJSON_STATIC in your application. Mark
[Prev in Thread] | Current Thread | [Next in Thread] |