Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved] *.obj files not found when using msvc
QtWS25 Last Chance

[solved] *.obj files not found when using msvc

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 7.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mortl
    wrote on last edited by
    #1

    Hi,
    I am working on a project and I am trying to compile it with the Msvc 2010. It compiles perfectly when using the MinGw compiler, but due to compatibility reasons I have to use Msvc.
    When I am building the program all files compile, and the *.obj files are existing.
    But afterwards I get some errors like:

    @PrimaryEmotion.obj:-1: Fehler: LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall AffectiveState::AffectiveState(class AffectiveState const &)" (??0AffectiveState@@QAE@ABV0@@Z)".@

    (unresolved symbols) and a hint, that (in this case noted above) the file PrimaryEmotion.obj was not found.
    I read in some forums that this might be an error which comes from the linker.
    I do not know if this is relevant, but the code compiles to a dll file.

    Any suggestions what I am doing wrong?

    Regards,
    Jan

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you trying to build a MinGW Qt project with Visual Studio ? If so, it won't work, you have to get a matching Qt installed

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Mortl
        wrote on last edited by
        #3

        No, the project is pure c++ without any dependencies. It was written with Qt-Creator but you should be able to compile all source files with any compiler.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          So are you using still using Qt Creator ? Did you setup the compiler and linker correctly ?

          And are you sure you are linking to your library correctly ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Mortl
            wrote on last edited by
            #5

            Yes I am using Qt Creator with "Qt 5.2.0 MSVC2010 32bit OpenGL" and the "msvc 10 x86" compiler. I am pretty shure this is correct, because the compilation does not fail, but the linking.

            A am not linking agains any library outside of the project. The linking errors come from *.obj files which are not found, but are compiled from within the project.

            As I said the project compiles fine with MinGW so this might be a msvc issue. Any msvc specific stuff that I do not see in the documentation.

            For clearance here the complete compiler output.

            @01:16:22: Führe Schritte für Projekt WASABIEngine aus...
            01:16:22: Starte "C:\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\bin\qmake.exe" C:\Users\Mortl\Desktop\WASABIQtGui\WASABIEngine\WASABIEngine.pro -r -spec win32-msvc2010
            01:16:23: Der Prozess "C:\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\bin\qmake.exe" wurde normal beendet.
            01:16:23: Starte "C:\Qt\Qt5.2.0\Tools\QtCreator\bin\jom.exe"
            C:\Qt\Qt5.2.0\Tools\QtCreator\bin\jom.exe -f Makefile.Release
            cl -c -nologo -Zm200 -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DWASABIENGINE_LIBRARY -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -I"..........\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\include" -I"..........\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\include\QtCore" -I"release" -I"." -I"..........\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\mkspecs\win32-msvc2010" -Forelease\ @C:\Users\Mortl\AppData\Local\Temp\WASABIRunner.obj.2992.15.jom
            WASABIRunner.cc
            WASABIEngine.cc
            SecondaryEmotion.cc
            PrimaryEmotion.cc
            EmotionDynamics.cc
            Code wird generiert...
            cl -c -nologo -Zm200 -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DWASABIENGINE_LIBRARY -DQT_NO_DEBUG -DQT_CORE_LIB -DNDEBUG -I"..........\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\include" -I"..........\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\include\QtCore" -I"release" -I"." -I"..........\Qt\Qt5.2.0\5.2.0\msvc2010_opengl\mkspecs\win32-msvc2010" -Forelease\ @C:\Users\Mortl\AppData\Local\Temp\EmotionConverter.obj.2992.15.jom
            EmotionConverter.cc
            EmotionContainer.cc
            cogaEmotionalAttendee.cc
            cogaAttendee.cc
            AffectiveState.cc
            Code wird generiert...
            link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /MANIFEST /MANIFESTFILE:release\WASABIEngine.dll.embed.manifest /OUT:release\WASABIEngine.dll @C:\Users\Mortl\AppData\Local\Temp\WASABIEngine.dll.2992.7593.jom
            Bibliothek "release\WASABIEngine.lib" und Objekt "release\WASABIEngine.exp" werden erstellt.
            SecondaryEmotion.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __thiscall AffectiveState::AffectiveState(class AffectiveState const &)" (??0AffectiveState@@QAE@ABV0@@Z)" in Funktion ""public: __thiscall SecondaryEmotion::SecondaryEmotion(class SecondaryEmotion const &)" (??0SecondaryEmotion@@QAE@ABV0@@Z)".
            PrimaryEmotion.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall AffectiveState::AffectiveState(class AffectiveState const &)" (??0AffectiveState@@QAE@ABV0@@Z)".
            EmotionContainer.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall AffectiveState::AffectiveState(class AffectiveState const &)" (??0AffectiveState@@QAE@ABV0@@Z)".
            release\WASABIEngine.dll : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
            jom: C:\Users\Mortl\Desktop\WASABIQtGui\build-WASABIEngine\Makefile.Release [release\WASABIEngine.dll] Error 1120
            jom: C:\Users\Mortl\Desktop\WASABIQtGui\build-WASABIEngine\Makefile [release] Error 2
            01:16:30: Der Prozess "C:\Qt\Qt5.2.0\Tools\QtCreator\bin\jom.exe" wurde mit dem Rückgabewert 2 beendet.
            Fehler beim Erstellen/Deployment des Projekts WASABIEngine(Kit: Desktop Qt 5.2.0 MSVC2010 32bit OpenGL)
            Bei der Ausführung von Schritt 'Make'
            01:16:30: Verstrichene Zeit: 00:08.@

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kenchan
              wrote on last edited by
              #6

              Hi, Are you sure all your function call are spelled correctly?

              AffectiveState::AffectiveState -> EffectiveState::EffectiveState ?? spelling mistakes or just outdated objects are often the cause of this kind of thing.

              Try a clean all and a rebuild :-)

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mortl
                wrote on last edited by
                #7

                As I said, the project compiles fine with an other compiler (MinGW) so the problem can not be a spelling mistake.
                I always clean the project before building, somtimes by manually deleting the whole build directory.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Mortl
                  wrote on last edited by
                  #8

                  I have found the solution:

                  In the header file there is a copy constructor declared but in the source file not defined. MinGW does not care about that, but MSVC throws therse errors while linking.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Indeed, gcc and msvc (also clang) have different sensitivities about such things (also e.g. order of initialization)

                    Great you found and and thanks for sharing !
                    Can you also update the thread title prepending [solved] ? So other forum users may know a solution has been found :)

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved