Results 1 to 4 of 4

Thread: Qt 4.3.2 vcproj generation annoyance

  1. #1
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt 4.3.2 vcproj generation annoyance

    I just started using qt-win-opensource-src-4.3.2 for windows and noticed some differences in the generation of MSVC workspaces from the patched versions I used before. Most of the changes are benign, like new warnings showing up, but I find a couple of things very annoying and I intend to gripe about them:
    In my pro files I always add the following statement
    Qt Code:
    1. CONFIG(debug, debug|release){
    2. TARGET = $$join(TARGET,,,_d)
    3. }
    To copy to clipboard, switch view to plain text mode 
    so that I can use parallell release and debug builds. This works fine on linux and windows, creating libraries called NAME_d.dll or libNAME_d.so in debug mode. I'm just annoyed that the vcproj file ends up being called NAME_d.vcproj. Also my subdirs project always ends up generating "Makefile.sln" as opposed to "MyProject.sln"

    Also, the recommended way of adding librarys like this:
    Qt Code:
    1. LIBS += -Llibdir -llib1 -llib2 ...
    To copy to clipboard, switch view to plain text mode 
    doesn't seem to work with MSVC. I always end up having to write
    Qt Code:
    1. unix:LIBS += -Llibdir -llib1 -llib2 ...
    2. win32:LIBS += libdir/lib1.lib libdir/lib2.lib ...
    To copy to clipboard, switch view to plain text mode 

    And finally I would very much like the following to work with MSVC:
    Qt Code:
    1. LIBRARIES = blah blahh blahhh
    2.  
    3. CONFIG(release, debug|release){
    4. LIBS += $$join(LIBRARIES, " -l", "-L../lib -l",)
    5. }
    6.  
    7. CONFIG(debug, debug|release){
    8. LIBS += $$join(LIBRARIES, "_d -l", "-L../lib -l", "_d")
    9. TARGET = $$join(TARGET,,,_d)
    10. }
    To copy to clipboard, switch view to plain text mode 
    It would be so much easier if this would work and I could put it in a pri file. Then my pro files(more than twenty) would consist solely of an include statement, TARGET, LIBRARIES, HEADERS and SOURCES.

    I've submitted this information to TT, but I'd like to hear if anybody else has any ideas or workarounds in the mean time.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt 4.3.2 vcproj generation annoyance

    I wouldn't use any workarounds. Qt 4.3.2 has a support for msvc built in into the opensource release (as opposed to earlier versions) so it might not be entirely stable. I've never heard of -L not working as it is qmake that provides the rule to transform -Lxxx statements into proper compiler switches. I suggest you wait for TT response. What version of the compiler are you using?

  3. #3
    Join Date
    May 2006
    Location
    Stuttgart, Germany
    Posts
    22
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.2 vcproj generation annoyance

    Hi spud,

    I suppose you're using VC Express 2005. I'm using the opensource version of Qt 4.3.2 & I also noticed these changes in vcprog generation of qmake.

    Unfortunately I don't have a workaround for these changes, but I compared vcproj xml file generated by qmake and noticed that default compiler settings have changed, projects now are generated with compiler switches
    CRT_SECURE_NO_DEPRECATE,_CRT_NONSTDC_NO_DEPRECATE
    meaning stricter settings for deprecated functions from standard library (like strcpy, sprintf,...)

    I wrote this to Qt interest mailing list but there was no real statement from official TT folks to this issue.

    Anyways, if you get any real solution or workaround I'd be glad to hear about it.

    Regards,
    AlGaN

  4. #4
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.3.2 vcproj generation annoyance

    I've got an answer from TT and the first problem with the name of the .vcproj files is solved by using the undocumented scope build_pass, as in:
    Qt Code:
    1. build_pass:CONFIG(debug, debug|release){
    2. TARGET = $$join(TARGET,,,_d)
    3. }
    To copy to clipboard, switch view to plain text mode 

    The problem with "$$join(LIBRARIES" seems to have been a mistake on my part.
    Now it works fine for me. At least with 4.3.2.

    @AlGaN:
    I don't mind the new warnings as they are all valid warnings, which make my code more safe and portable, but the flags you mentioned actually tell the compiler not to warn about deprecated functions.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.