Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:38:44+00:00 2026-06-05T22:38:44+00:00

I was trying to build a QT project in QT Creator, but was getting

  • 0

I was trying to build a QT project in QT Creator, but was getting link errors:

minecraftlauncher.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl Launcher::MinecraftLauncher::metaObject(void)const " (?metaObject@MinecraftLauncher@Launcher@@UEBAPEBUQMetaObject@@XZ)
minecraftlauncher.obj : error LNK2001: unresolved external symbol "public: virtual void * __cdecl Launcher::MinecraftLauncher::qt_metacast(char const *)" (?qt_metacast@MinecraftLauncher@Launcher@@UEAAPEAXPEBD@Z)
minecraftlauncher.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl Launcher::MinecraftLauncher::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@MinecraftLauncher@Launcher@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
debug\Launcher.exe : fatal error LNK1120: 3 unresolved externals

For some reason, moc.exe, the meta-object compiler, was creating empty moc_*.cpp files, with the error message

:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/include/type_trait(0): Note: No relevant classes found. No output generated.

I tried running mocat the command line with the flags it had been run with in QT Creator:

C:\QtSDK\x64\bin\moc.exe -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\QtSDK\x64\include\QtCore" -I"c:\QtSDK\x64\include\QtGui" -I"c:\QtSDK\x64\include" -I"c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include" -I"c:\QtSDK\x64\include\ActiveQt" -I"debug" -I"..\Launcher" -I"." -I"c:\QtSDK\x64\mkspecs\win32-msvc2005" -D_MSC_VER=1400 -DWIN32 ..\Launcher\minecraftlauncher.hpp -o debug\moc_minecraftlauncher.cpp

and it returned the same error. I tried removing several flags one by one, and narrowed it down to -I"c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include". For some reason, when that directory was on the include path, the “No relevant classes found” error was shown and an empty .cpp file was generated. However, when that directory was not on the include path, moc.exe worked normally.

Due to the error message including :/Program Files (x86)/Microsoft Visual Studio 11.0/VC/include/type_trait(0), I tried renaming the type_traits file in that location so it wouldn’t be recognised. When I did that, moc.exe worked normally again (but actual failed as type_traits is included somewhere in the standard library files I have included).
So the error is being caused somewhere in type_traits

From what little I know about type_traits, I believe it has something to do with getting compile type information about an object. But I have no idea why it is causing the meta-object compiler to err. Why is it doing this? What is moc doing with type_traits, why is it and what is failing?

I will be very grateful for any insight anyone can provide, as this has been very puzzling for me.

The minecraftlauncher.hpp file:

#ifndef MINECRAFTLAUNCHER_HPP
#define MINECRAFTLAUNCHER_HPP

#include <QMainWindow>
namespace Launcher {
    class MinecraftLauncher : public QMainWindow
    {
        Q_OBJECT

    public:
        explicit MinecraftLauncher(QWidget *parent = 0);
        ~MinecraftLauncher();

    private:

    };
}

#endif // MINECRAFTLAUNCHER_HPP
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:38:46+00:00Added an answer on June 5, 2026 at 10:38 pm

    This is most likely a moc bug exposed by C++11 headers. I bet you didn’t recompile Qt from the sources, as that would similarly fail.

    Visual Studio 11 is not supported by Qt. It’s not even in tier2 support. The workaround is to use MSVC 2010 until the bug is fixed, or for you to fix moc and submit a patch 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build my project and I am getting a weird error
I am getting the error below when trying to build the web site project
I'm getting this error when trying to build a project and run it on
I am trying to build a project on Linux via Makefile. I keep getting
i'm using QT Creator 1.3.1 and trying to compile, but get this error... please
I'm trying to build a project with Xcode 4.5.1, created with Xcode 4.4, but
I am trying to build a project using Maven but I don't know Maven.
Got this error today while trying to build a project with checkstyle. This works
I'm trying to build a project in Visual Studio 2008. I'm getting a bunch
I am trying to use an external library in my Qt Creator project. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.