[cmake-developers] [CMake 0015103]: AUTORCC fails with more than one .qrc file per target

Mantis Bug Tracker mantis at public.kitware.com
Mon Aug 25 06:25:53 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15103 
====================================================================== 
Reported By:                Hendrik Sattler
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15103
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-08-25 06:25 EDT
Last Modified:              2014-08-25 06:25 EDT
====================================================================== 
Summary:                    AUTORCC fails with more than one .qrc file per
target
Description: 
Using VisualStudio 2010.

9>  qrc_icons.cpp
9>  qrc_moreicons.cpp
9>qrc_moreicons.obj : error LNK2005: "int __cdecl qInitResources(void)"
(?qInitResources@@YAHXZ) already defined in qrc_moreicons.obj
9>qrc_moreicons.obj : error LNK2005: "int __cdecl qCleanupResources(void)"
(?qCleanupResources@@YAHXZ) already defined in qrc_moreicons.obj
9>qrc_moreicons.obj : error LNK2005: "class qCleanupResources__dest_class__
qCleanupResources__dest_instance__"
(?qCleanupResources__dest_instance__@@3VqCleanupResources__dest_class__@@A)
already defined in qrc_moreicons.obj

Steps to Reproduce: 
set ( CMAKE_AUTORCC ON )

and remove the qt4_add_resources() macro call.

I use this on 2 shared library target and one executable and in all three cases
it fails.

Additional Information: 
Previously, _all_ .qrc file were in _one_ qt4_add_resources() macro call.
The Qt rcc does automatically prepend the file base name to the symbol, so

int QT_MANGLE_NAMESPACE(qInitResources_icons)()
and
int QT_MANGLE_NAMESPACE(qInitResources_moreicons)()

instead of twice
int QT_MANGLE_NAMESPACE(qInitResources)()

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-08-25 06:25 Hendrik SattlerNew Issue                                    
======================================================================



More information about the cmake-developers mailing list