Bug 1092465 - Linking fails on a cmake based project using Qt 5 since libqtmain.a is not found
Summary: Linking fails on a cmake based project using Qt 5 since libqtmain.a is not found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-qt5-qtbase
Version: 19
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Erik van Pienbroek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-29 11:31 UTC by Aki Koskinen
Modified: 2014-05-13 19:23 UTC (History)
1 user (show)

Fixed In Version: mingw-qt5-qtbase-5.2.1-3.fc20
Clone Of:
Environment:
Last Closed: 2014-05-13 19:20:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test case for the bug (622 bytes, application/gzip)
2014-04-29 19:52 UTC, Aki Koskinen
no flags Details

Description Aki Koskinen 2014-04-29 11:31:51 UTC
Description of problem:

Trying to cross-compile a Qt 5 based project for Windows using mingw. The build system of the project is cmake. Linking an executable fails with error: 

make[2]: *** No rule to make target `/usr/i686-w64-mingw32/sys-root/mingw/lib/libqtmain.a', needed by <the binary name>. Stop.

Version-Release number of selected component:
5.2.1-1.fc19

How reproducible: always

Steps to Reproduce:
1. have a Qt 5 based project using cmake
2. execute mingw32-cmake
3. execute make

Actual results:
Linking fails as described above

Expected results:
Linking should succeed

Additional info:

The problem seems to be that the build process looks for a file called libqtmain.a in /usr/i686-w64-mingw32/sys-root/mingw/lib directory. But the file provided by the mingw32-qt5-qtbase package is called libqt5main.a which I guess should be used instead.

The wrong path comes from the
/usr/i686-w64-mingw32/sys-root/mingw/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake
file on line 76 which says:
set(imported_location "${_qt5Core_install_prefix}/lib/libqtmain.a")

I changed that line to use the libqt5main.a file and then the linking succeeded.

Comment 1 Erik van Pienbroek 2014-04-29 17:00:39 UTC
Do you have a minimal CMakeLists.txt which shows this behaviour?

Comment 2 Aki Koskinen 2014-04-29 19:52:56 UTC
Created attachment 890918 [details]
Test case for the bug

Running the test:
Extract the archive and cd to the directory it created
$> mingw32-cmake .
$> mingw32-make

Comment 3 Erik van Pienbroek 2014-04-30 19:16:30 UTC
Thanks for the testcase!
I've prepared a new build (against Fedora 19) which should fix the problem (though I didn't fully test it yet): https://koji.fedoraproject.org/koji/taskinfo?taskID=6796108
Could you check if this resolves the issue for you?

Comment 4 Aki Koskinen 2014-05-03 06:05:51 UTC
(In reply to Erik van Pienbroek from comment #3)
> I've prepared a new build (against Fedora 19) which should fix the problem
> Could you check if this resolves the issue for you?

This seems to fix the issue.

Comment 5 Fedora Update System 2014-05-04 10:29:49 UTC
mingw-qt5-qtbase-5.2.1-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/mingw-qt5-qtbase-5.2.1-3.fc19

Comment 6 Fedora Update System 2014-05-04 10:30:49 UTC
mingw-qt5-qtbase-5.2.1-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mingw-qt5-qtbase-5.2.1-3.fc20

Comment 7 Fedora Update System 2014-05-06 03:28:25 UTC
Package mingw-qt5-qtbase-5.2.1-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mingw-qt5-qtbase-5.2.1-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-5988/mingw-qt5-qtbase-5.2.1-3.fc20
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2014-05-13 19:20:06 UTC
mingw-qt5-qtbase-5.2.1-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2014-05-13 19:23:05 UTC
mingw-qt5-qtbase-5.2.1-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.