Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64248

'"class QLoggingCategory ... already defined in main.obj' error for static builds on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.11
    • GUI: Vulkan
    • None
    •  * Windows 10 x64,
        * MSVC 2017 15.4.1,
        * Windows SDK 10.0.16299.15,
        * Qt-5.11-dev (037335f4bfb8a41cc744f308f5442092f2b0ca3b).

    Description

      Hello everyone,

       

      For builds using MSVC got error:

              cd hellovulkanwindow\ && ( if not exist Makefile C:\libQT-5.11-dev\build\qtbase\bin\qmake.exe -o Makefile C:\libQT-5.11-dev\build\qtbase\examples\vulkan\hellovulkanwindow\hellovulkanwindow.pro ) && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\nmake.exe" -f Makefile
      
      Microsoft (R) Program Maintenance Utility Version 14.11.25547.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
              "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\nmake.exe" -f Makefile.Release
      
      Microsoft (R) Program Maintenance Utility Version 14.11.25547.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
              link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:release\hellovulkanwindow.exe @C:\Users\test\AppData\Local\Temp\nm3D87.tmp
      Qt5VulkanSupport.lib(qbasicvulkanplatforminstance.obj) : error LNK2005: "class QLoggingCategory const & __cdecl lcVk(void)" (?lcVk@@YAAEBVQLoggingCategory@@XZ) already defined in main.obj
      Qt5Gui.lib(qvulkanwindow.obj) : error LNK2005: "class QLoggingCategory const & __cdecl lcVk(void)" (?lcVk@@YAAEBVQLoggingCategory@@XZ) already defined in main.obj
         Creating library release\hellovulkanwindow.lib and object release\hellovulkanwindow.exp
      release\hellovulkanwindow.exe : fatal error LNK1169: one or more multiply defined symbols found
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\link.EXE"' : return code '0x491'
      Stop.
      NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX64\x64\nmake.exe"' : return code '0x2'
      Stop.
      NMAKE : fatal error U1077: 'cd' : return code '0x2'
      Stop.
      

       

      Reproduced for:
        - QtBase-dev builds using MSVC with Static layout,

      not reproduced for:
        - QtBase-dev builds using MSVC with Shared layout.

       

      The same error reproduced for:
      hellovulkantriangle
      hellovulkantexture
      hellovulkanwidget
      hellovulkancubes

      builds too.

       

      Reverting QtBase\examples\vulkan sources to 8d72aba9e3358fdf51578533ab7f46602f7fd103 doesn't solve this issue.

       

      Best,

      Alexander

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              lagocs Laszlo Agocs
              sav sav
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes