Results 1 to 2 of 2

Thread: refreshtest example won't compile in VS2005 with Qt4.6.1 and Qwt 6.0.0-svn

  1. #1
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default refreshtest example won't compile in VS2005 with Qt4.6.1 and Qwt 6.0.0-svn

    I have just downloaded the latest Qt 4.6.1 and also the trunk version of Qwt 6.0.0-svn. Because I am using MSVC 2005 I recompiled from scratch the Qt libraries without issue. I then tried to compile the Qwt library (note both done with debug-and-release build settings) which went smoothly until it tried to compile the refreshtest example. This it compiled but failed the link stage with:

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.

    rc -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQWT_DLL -DQT_THREAD_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_GUI_LIB -DQT_CORE_LIB -fo obj\refreshtest_resource.res refreshtest_resource.rc
    compiling .\circularbuffer.cpp .\panel.cpp .\plot.cpp .\mainwindow.cpp .\main.cpp
    circularbuffer.cpp
    panel.cpp
    plot.cpp
    mainwindow.cpp
    main.cpp
    Generating Code...
    compiling moc\moc_panel.cpp moc\moc_plot.cpp
    moc_panel.cpp
    moc_plot.cpp
    Generating Code...
    linking ..\..\examples\bin\refreshtest.exe
    panel.obj : fatal error LNK1179: invalid or corrupt file: duplicate COMDAT '??0<unnamed-tag>@Settings@@QAE@XZ'
    NMAKE : fatal error U1077: 'echo' : return code '0x49b'
    Stop.


    It seems to fail in the same way regardless of whether release or debug builds are selected. All other examples build fine so I just commented this one out.

    I have seen an MS reference to this error here, but it seemed to indicate a situation which I don't believe is valid in this case, where there can be a name comflict due to certain compiler flag options. I also got this error when I tried Qt 4.6.0 and Qwt 5.2.0 and 5.x-svn.

    The only workaround for this I have found was by way of a reference to a problem under VC 6.0 here, where if you explicitly set the Inline Function Expansion to Only __inline (/Ob1) then the problem goes away, but I don't understand why.

    Correction, the above only worked for the debug build within MSVC not the release build!

    Any suggestions?
    Last edited by mike_the_tv; 20th January 2010 at 11:30. Reason: Additional information.

  2. #2
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: refreshtest example won't compile in VS2005 with Qt4.6.1 and Qwt 6.0.0-svn

    Tried various fixes for this such as moving the constructor definition for Settings() to outside the class definition. No help.

    Finally stumbled upon this article here that said the problem was due to two or more unnamed structures in a class definition. Indeed the Settings() class has three. Simple solution therefore is to name the structures grid_struct, curve_struct and canvas_struct. Compiler error goes away now.

    See diff below.

    David

    Qt Code:
    1. ===================================================================
    2. --- examples/refreshtest/settings.h (revision 689)
    3. +++ examples/refreshtest/settings.h (working copy)
    4. @@ -40,12 +40,12 @@
    5. updateInterval = 20;
    6. }
    7.  
    8. - struct
    9. + struct grid_struct
    10. {
    11. QPen pen;
    12. } grid;
    13.  
    14. - struct
    15. + struct curve_struct
    16. {
    17. QPen pen;
    18. QBrush brush;
    19. @@ -56,7 +56,7 @@
    20. bool lineSplitting;
    21. } curve;
    22.  
    23. - struct
    24. + struct canvas_struct
    25. {
    26. bool cached;
    27. bool paintOnScreen;
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QtCreator won't compile using VS2005
    By Spinz99 in forum Installation and Deployment
    Replies: 0
    Last Post: 4th April 2009, 00:25
  2. qt and vs2005
    By xenry in forum Installation and Deployment
    Replies: 2
    Last Post: 17th March 2009, 08:56
  3. cannot compile the MainWindow example with vs2005
    By billconan in forum Qt Programming
    Replies: 5
    Last Post: 31st May 2008, 19:27
  4. Do not use VS2005 SP1 with Qt4
    By ChristianEhrlicher in forum Installation and Deployment
    Replies: 21
    Last Post: 2nd February 2008, 15:48
  5. Qt4 with VS2005
    By bkastel1 in forum Qt Programming
    Replies: 9
    Last Post: 6th November 2007, 13:54

Tags for this Thread

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.