Qt-interest Archive, May 2008
Duplicate headers loaded
Message 1 in thread
Hi,
I have a nuisance problem. It really doesn't hurt anything but I'm curious as to what I am doing to cause it.
I am using VS2005 and a .pro qmake file. Everything loads and builds correctly. However, I get two copies of the header files loaded in VS2005. Not all headers are duplicated, only those containing Q_OBJECT. If I remove the header from the HEADERS= portion of the .pro file no header is loaded. If I include it I get two copies. After I build I can remove one copy from VS2005 and continue w/o problems.
Has anyone else experienced this? I suspect I am at fault here but I do not know where.
Thanks.
Don
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Message 2 in thread
Is it the actual headers or the generated code (the results from moc/uic)
If itâs the former, Im stumped and have never seen that.
However, if itâs the latter, its because you have 2 target directories, 1 for debug 1 for release set for your moc and ui files.
You will notice, if you do a properties on each file, that they are actually in different locations
Scott
From: Kellmel, Don [mailto:Don.Kellmel@xxxxxxxxxxxxxx]
Sent: Thursday, May 15, 2008 2:45 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Duplicate headers loaded
Hi,
I have a nuisance problem. It really doesn't hurt anything but I'm curious as to what I am doing to cause it.
I am using VS2005 and a .pro qmake file. Everything loads and builds correctly. However, I get two copies of the header files loaded in VS2005. Not all headers are duplicated, only those containing Q_OBJECT. If I remove the header from the HEADERS= portion of the .pro file no header is loaded. If I include it I get two copies. After I build I can remove one copy from VS2005 and continue w/o problems.
Has anyone else experienced this? I suspect I am at fault here but I do not know where.
Thanks.
Don
________________________________
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
________________________________
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Message 3 in thread
Thanks for the quick reply Scott.
It is the actual headers.
Don
________________________________
From: Scott Aron Bloom [mailto:Scott.Bloom@xxxxxxxxxxxx]
Sent: Thu 5/15/2008 5:49 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: RE: Duplicate headers loaded
Is it the actual headers or the generated code (the results from moc/uic)
If it's the former, Im stumped and have never seen that.
However, if it's the latter, its because you have 2 target directories, 1 for debug 1 for release set for your moc and ui files.
You will notice, if you do a properties on each file, that they are actually in different locations
Scott
From: Kellmel, Don [mailto:Don.Kellmel@xxxxxxxxxxxxxx]
Sent: Thursday, May 15, 2008 2:45 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Duplicate headers loaded
Hi,
I have a nuisance problem. It really doesn't hurt anything but I'm curious as to what I am doing to cause it.
I am using VS2005 and a .pro qmake file. Everything loads and builds correctly. However, I get two copies of the header files loaded in VS2005. Not all headers are duplicated, only those containing Q_OBJECT. If I remove the header from the HEADERS= portion of the .pro file no header is loaded. If I include it I get two copies. After I build I can remove one copy from VS2005 and continue w/o problems.
Has anyone else experienced this? I suspect I am at fault here but I do not know where.
Thanks.
Don
________________________________
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
________________________________
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Message 4 in thread
Scott,
You gave me a clue so I tried something.
I use the following in the .pro file:
CONFIG -= debug_and_release
CONFIG += qt warn_on release embed_manifest_exe
I commented out the -= line and then only got one copy of the headers. However, I was using that because w/o it I am set up for a debug build vice a release even though I specify release. With it in there I get set up up for a release build but get the duplicated headers load. I suppose I will have to manually change it from debug to release in VS2005. That works but I have to do it. Anyway that seems to be the cause.
Don
________________________________
From: Scott Aron Bloom [mailto:Scott.Bloom@xxxxxxxxxxxx]
Sent: Thu 5/15/2008 5:49 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: RE: Duplicate headers loaded
Is it the actual headers or the generated code (the results from moc/uic)
If it's the former, Im stumped and have never seen that.
However, if it's the latter, its because you have 2 target directories, 1 for debug 1 for release set for your moc and ui files.
You will notice, if you do a properties on each file, that they are actually in different locations
Scott
From: Kellmel, Don [mailto:Don.Kellmel@xxxxxxxxxxxxxx]
Sent: Thursday, May 15, 2008 2:45 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Duplicate headers loaded
Hi,
I have a nuisance problem. It really doesn't hurt anything but I'm curious as to what I am doing to cause it.
I am using VS2005 and a .pro qmake file. Everything loads and builds correctly. However, I get two copies of the header files loaded in VS2005. Not all headers are duplicated, only those containing Q_OBJECT. If I remove the header from the HEADERS= portion of the .pro file no header is loaded. If I include it I get two copies. After I build I can remove one copy from VS2005 and continue w/o problems.
Has anyone else experienced this? I suspect I am at fault here but I do not know where.
Thanks.
Don
________________________________
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
________________________________
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
Message 5 in thread
Kellmel, Don wrote:
> Scott,
>
> You gave me a clue so I tried something.
>
> I use the following in the .pro file:
>
> CONFIG -= debug_and_release
>
> CONFIG += qt warn_on release embed_manifest_exe
>
> I commented out the -= line and then only got one copy of the headers.
> However, I was using that because w/o it I am set up for a debug build
> vice a release even though I specify release. With it in there I get
> set up up for a release build but get the duplicated headers load. I
> suppose I will have to manually change it from debug to release in
> VS2005. That works but I have to do it. Anyway that seems to be the cause.
>
Two questions:
1) Did you generate the .pro file with "qmake -project"? If so, it
often duplicates files in SOURCES and HEADERS - that could be your cause.
2) Are you actually specifying HEADERS in the .pro file, or are you
letting qmake figure it out for you? If qmake is figuring it out when
you generate the Studio file, see also 1) - it's probably overguessing.
--
[ signature omitted ]
Message 6 in thread
Gordon,
Thanks for your response.
1) no -project
2) I am specifying th headers - see below
TEMPLATE = vcapp
LANGUAGE = C++
QT += opengl
CONFIG -= debug_and_release
CONFIG += qt warn_on release embed_manifest_exe
DEFINES += _FILE_OFFSET_BITS=64 \
_LARGE_FILES \
HAS_OPEN_THREADS=1 \
HAVE_CONFIG_H \
MPI_SETTING=0 \
GEOTIFF_ENABLED \
FREETYPE_SETTING=1 \
NOMINMAX
UI_HEADERS_DIR = include
UI_SOURCE_DIR = ui
MOC_DIR = moc
OBJECTS_DIR = obj
VERSION = 1.0.0
TARGET = save
DESTDIR = release
SOURCES = \
src/main.cpp \
src/saveGlobals.cpp \
src/saveMainWindow.cpp \
src/saveAboutDialog.cpp \
src/saveSessionInfo.cpp \
src/saveConfiguration.cpp \
src/saveLegendsAndViews.cpp \
src/saveRelativeInfoDialog.cpp
HEADERS = \
include/qtGlobals.h \
include/saveGlobals.h \
include/saveMainWindow.h \
include/saveAboutDialog.h \
include/saveSessionInfo.h \
include/saveConfiguration.h \
include/saveLegendsAndViews.h \
include/saveRelativeInfoDialog.h
INCLUDEPATH += \
include \
..\Qt\4.3-msvc2005\include \
..\Qt\4.3-msvc2005\mkspecs\win32-msvc2005 \
..\ossim/VS2005/ossim/include \
..\ossim/VS2005/libwms/include \
..\ossim/VS2005/ossimPlanet/include \
..\ossim/VS2005/ossimPlanetQt/include \
..\ossim/VS2005/ossim_dependencies/src/3rdParty/include \
..\ossim/VS2005/ossim_dependencies/src/OpenSceneGraph-2.4.0/include
LIBPATH = \
..\Qt\4.3-msvc2005\lib \
..\ossim/VS2005/ossimPlanetQt/lib \
..\ossim/VS2005/ossim/projects/vs2005/release/lib \
..\ossim/VS2005/ossim_dependencies/src/3rdParty/lib \
..\ossim/VS2005/ossim_dependencies/src/OpenSceneGraph-2.4.0/lib
LIBS += \
-losg \
-losgGA \
-losgDB \
-lossim \
-llibwms \
-lQtXml4 \
-losgText \
-losgUtil \
-llibjpeg \
-lossimPlanet \
-lossimPlanetQt1 \
-lOpenThreads
________________________________
From: Gordon Schumacher [mailto:gordon@xxxxxxxxx]
Sent: Thu 5/15/2008 6:28 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Duplicate headers loaded
Kellmel, Don wrote:
> Scott,
>
> You gave me a clue so I tried something.
>
> I use the following in the .pro file:
>
> CONFIG -= debug_and_release
>
> CONFIG += qt warn_on release embed_manifest_exe
>
> I commented out the -= line and then only got one copy of the headers.
> However, I was using that because w/o it I am set up for a debug build
> vice a release even though I specify release. With it in there I get
> set up up for a release build but get the duplicated headers load. I
> suppose I will have to manually change it from debug to release in
> VS2005. That works but I have to do it. Anyway that seems to be the cause.
>
Two questions:
1) Did you generate the .pro file with "qmake -project"? If so, it
often duplicates files in SOURCES and HEADERS - that could be your cause.
2) Are you actually specifying HEADERS in the .pro file, or are you
letting qmake figure it out for you? If qmake is figuring it out when
you generate the Studio file, see also 1) - it's probably overguessing.
--
[ signature omitted ]
Message 7 in thread
Kellmel, Don wrote:
> Gordon,
>
> Thanks for your response.
>
> 1) no -project
> 2) I am specifying th headers - see below
>
Aha, yeah - forgot about that one.
99.99% of the time, you want "FOO *= bar baz" instead of "FOO += bar
baz". The only time off the top of my head that this isn't true is when
you're trying to override debug or release mode - on an exclusive toggle
like that, the last one in the list wins, so you either say "CONFIG +=
debug" or "CONFIG -= release".
--
[ signature omitted ]
Message 8 in thread
Hi Gordon,
I'm not quite sure what you are telling me. Sorry.
I tried all sorts of CONFIG -=, += and moved them around. I either get a debug mode or I get a release mode with header duplicates.
Don
________________________________
From: Gordon Schumacher [mailto:gordon@xxxxxxxxx]
Sent: Thu 5/15/2008 7:15 PM
To: Qt-Interest
Subject: Re: Duplicate headers loaded
Kellmel, Don wrote:
> Gordon,
>
> Thanks for your response.
>
> 1) no -project
> 2) I am specifying th headers - see below
>
Aha, yeah - forgot about that one.
99.99% of the time, you want "FOO *= bar baz" instead of "FOO += bar
baz". The only time off the top of my head that this isn't true is when
you're trying to override debug or release mode - on an exclusive toggle
like that, the last one in the list wins, so you either say "CONFIG +=
debug" or "CONFIG -= release".
--
[ signature omitted ]
Message 9 in thread
Kellmel, Don wrote:
> Hi Gordon,
>
> I'm not quite sure what you are telling me. Sorry.
> I tried all sorts of CONFIG -=, += and moved them around. I either get
> a debug mode or I get a release mode with header duplicates.
The qmake operator plus-equal says "unconditionally add the following to
this variable", and star-equal says "add only if the following items are
not already present". So in a debug_and_release scenario, you end up
with multiple passes through the file, and I suspect it's adding the
files to your project each time.
--
[ signature omitted ]