Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, January 2007
[Qt4.2] Resources lost in [debug/release] executable


Message 1 in thread

We see a problem in our Qt GUI app that only occurs in the
release build:  Essentially, the text fields in several of the
widgets are missing ONLY in the release build.

MSVS.NET 2003, Qt4.1.2 Commerical.

It's strange -- the debug build is fine, and the release build
is fine if it's launched from within MSVS (Microsoft's Dev
Studio), even though the symbols are unavailable (because
it's a release build).  However, if you launch the release build
directly (outside MSVS), text fields in several of the widgets
are missing (no text, just blank background for that part of
the widget).

Summary:

Launching program in this way                        Text Status
==================================================   ===========
double-click on executable                           missing
type executable from within its directory            missing
type full path to program from MSVS launch dir       missing
MSVS -> Debug -> Start without debugging             missing
MSVS -> Debug -> Start                               NOT missing

It doesn't seem to matter what the "current" directory is
when the application is launched (we get the same behavior
no matter the "current" directory).

Does anyone have any ideas of what could be happening?  Or 
of how to track this down?

This should be unrelated, but this application happens to be
used for a touch-screen panel, and we're overriding QStyle
to get BIG controls (because it's a touch screen with a large
target area for your finger).  However, none of our code is
specific to "debug" or "release", but we're seeing different
behavior between those two builds.

Very strange...

--charley





 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail

--
 [ signature omitted ] 

Message 2 in thread

Charley Bay schrieb:
> ...
> Launching program in this way                        Text Status
> ==================================================   ===========
> double-click on executable                           missing
> type executable from within its directory            missing
> type full path to program from MSVS launch dir       missing
> MSVS -> Debug -> Start without debugging             missing
> MSVS -> Debug -> Start                               NOT missing

Hmmm, it's a complete shot into the dark, but here are the usual
suspects when this kind of situation happens (*.exe behaves differently
when started from within MSVS than when started from somewhere else).

- You have defined some extra PATHs or environment settings in Visual
  Studio (under project Properties) which are somehow necessary
  for your application (e.g. some DLLs are found/not found)

- You are actually executing a different *.exe than the one you'd
  expect when you hit F5 in Visual Studio (Start with debugging)
  (for example I copy the finished *.exe/*.dlls to some special "bin"
  folder in a post-build step, but sometimes I forget to change the
  debug path to point to the correct *.exe)

- Really clean every binary/object folder and rebuild from scratch
  (you wouldn't believe how many mysteries are solved
  like this! ;)


Actually I have no idea how this might help you - but you are probably
the "wrong" *.exe. What does the setting Properties/Debugging/Command
say? In Visual Studio by default it is set to $(TargetPath). Go to
"Edit", click on the "Macros>>" button and check the value of
$(TargetPath) to see if this is the same *.exe you are also trying to
start from outside of Visual Studio (maybe the one you are starting from
"outside" is a different one and outdated).

Hope that helps, Oliver

--
 [ signature omitted ] 

Message 3 in thread

When you double click, or type, are they debug exe's your running?

I would run dbmonitor, with a debug build, and see if any debug messages
are coming out.

Scott

> -----Original Message-----
> From: Charley Bay [mailto:charleyb123@xxxxxxxxx]
> Sent: Tuesday, January 16, 2007 9:46 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: [Qt4.2] Resources lost in [debug/release] executable
> 
> We see a problem in our Qt GUI app that only occurs in the
> release build:  Essentially, the text fields in several of the
> widgets are missing ONLY in the release build.
> 
> MSVS.NET 2003, Qt4.1.2 Commerical.
> 
> It's strange -- the debug build is fine, and the release build
> is fine if it's launched from within MSVS (Microsoft's Dev
> Studio), even though the symbols are unavailable (because
> it's a release build).  However, if you launch the release build
> directly (outside MSVS), text fields in several of the widgets
> are missing (no text, just blank background for that part of
> the widget).
> 
> Summary:
> 
> Launching program in this way                        Text Status
> ==================================================   ===========
> double-click on executable                           missing
> type executable from within its directory            missing
> type full path to program from MSVS launch dir       missing
> MSVS -> Debug -> Start without debugging             missing
> MSVS -> Debug -> Start                               NOT missing
> 
> It doesn't seem to matter what the "current" directory is
> when the application is launched (we get the same behavior
> no matter the "current" directory).
> 
> Does anyone have any ideas of what could be happening?  Or
> of how to track this down?
> 
> This should be unrelated, but this application happens to be
> used for a touch-screen panel, and we're overriding QStyle
> to get BIG controls (because it's a touch screen with a large
> target area for your finger).  However, none of our code is
> specific to "debug" or "release", but we're seeing different
> behavior between those two builds.
> 
> Very strange...
> 
> --charley
> 
> 
> 
> 
> 
> 
>
________________________________________________________________________
__
> __________
> No need to miss a message. Get email on-the-go
> with Yahoo! Mail for Mobile. Get started.
> http://mobile.yahoo.com/mail
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 4 in thread

Hello Charley,

I think the problem you have are relative paths. If you start your 
application via the Visual Studio Debugger your working directory is set 
to the folder where your solution lives - NOT the application's binary 
path! When you now reference images like "../images/myImage.png" it is 
found in the debugger because you have arranges the paths when testing 
with the debugger. But if you now start the release version the working 
directory is set to the application's executable path which is somewhere 
else. Your relative paths point to somewhere invalid.

To solve your problem you have to change the working directory of your 
debug exe in the project settings of Visual Studio to the executables 
path. Then you have to change all your relative paths to fit the new 
working directory.

You can test if you have this problem by reference an image via an 
absolute path like "C:/MyImages/test.png".

Good luck,

Falko

Am 16.01.2007 18:46, Charley Bay schrieb:
> We see a problem in our Qt GUI app that only occurs in the
> release build:  Essentially, the text fields in several of the
> widgets are missing ONLY in the release build.
>
> MSVS.NET 2003, Qt4.1.2 Commerical.
>
> It's strange -- the debug build is fine, and the release build
> is fine if it's launched from within MSVS (Microsoft's Dev
> Studio), even though the symbols are unavailable (because
> it's a release build).  However, if you launch the release build
> directly (outside MSVS), text fields in several of the widgets
> are missing (no text, just blank background for that part of
> the widget).
>
> Summary:
>
> Launching program in this way                        Text Status
> ==================================================   ===========
> double-click on executable                           missing
> type executable from within its directory            missing
> type full path to program from MSVS launch dir       missing
> MSVS -> Debug -> Start without debugging             missing
> MSVS -> Debug -> Start                               NOT missing
>
> It doesn't seem to matter what the "current" directory is
> when the application is launched (we get the same behavior
> no matter the "current" directory).
>
> Does anyone have any ideas of what could be happening?  Or 
> of how to track this down?
>
> This should be unrelated, but this application happens to be
> used for a touch-screen panel, and we're overriding QStyle
> to get BIG controls (because it's a touch screen with a large
> target area for your finger).  However, none of our code is
> specific to "debug" or "release", but we're seeing different
> behavior between those two builds.
>
> Very strange...
>
> --charley
>
>
>
>
>
>  
> ____________________________________________________________________________________
> No need to miss a message. Get email on-the-go 
> with Yahoo! Mail for Mobile. Get started.
> http://mobile.yahoo.com/mail 
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>   

--
 [ signature omitted ]