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. Compilation Error 3
Forum Updated to NodeBB v4.3 + New Features

Compilation Error 3

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 4.2k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    anand471
    wrote on last edited by
    #1

    I am developing a Qt dll project (SampleCOMDll.dll) with a library project named "samplelibrary" in Qt 5.2.1. using Qt Creator 3.0.1.
    On compilation I am getting a errors (Error 3).

    How do I fix this? Do I need any other pack to be installed.

    Project Details:
    I created an empty dll project named "SampleCOMDll" and a then a library project named "samplelibrary" (Template: Library --> C++ Library --> Shared Library)
    And I have an created an object for "samplelibrary" in "SampleCOMDll".

    On compilation of "SampleCOMDll" project, my application is giving a compile Error 3 without generating the idl file.
    But "SampleCOMDll.dll" is getting generated. I am not able to use the .dll in my application. (Error details are listed below).

    How do I fix this? Do I need any other pack to be installed?

    Also I observed that if I do not craete any object of "samplelibrary" in "SampleCOMDll", there are no compilation errors and idl is generated.

    P.S: I am using installation from pack "qt-opensource-windows-x86-mingw48_opengl-5.2.1.exe" and I have Microsoft Visual Studio 2008 installed.


    Compile output has the following errors.

    bq. C:\Qt\Qt5.2.1\5.2.1\mingw48_32\bin\idc.exe debug\SampleCOMDll.dll /idl debug/SampleCOMDll.idl -version 1.0
    debug\SampleCOMDll.idl
    Couldn't load library file debug\SampleCOMDll.dll
    Class has no metaobject information (error in debug\SampleCOMDll.dll)!
    Makefile.Debug:78: recipe for target 'debug\SampleCOMDll.dll' failed
    mingw32-make[1]: [debug\SampleCOMDll.dll] Error 3 (ignored)

    I am giving my Project Details below:

    Project "SampleCOMDll.pro" File:

    @TEMPLATE = lib
    TARGET = SampleCOMDll

    CONFIG += warn_off dll
    QT += axcontainer
    QT += axserver
    QT += widgets
    QT += opengl
    QT += core
    RC_FILE = SampleCOMDll.rc
    DEF_FILE = SampleCOMDll.def
    HEADERS +=
    sampleclass.h
    SOURCES +=
    sampleclass.cpp

    win32: LIBS += -L$$PWD/../Bin/debug/ -lSampleLibrary
    INCLUDEPATH += $$PWD/../Bin/debug
    DEPENDPATH += $$PWD/../Bin/debug@


    Project "samplelibrary" File:

    @QT += widgets opengl

    TARGET = SampleLibrary
    TEMPLATE = lib

    DEFINES += SAMPLELIBRARY_LIBRARY

    SOURCES += samplelibrary.cpp

    HEADERS += samplelibrary.h
    samplelibrary_global.h

    unix {
    target.path = /usr/lib
    INSTALLS += target
    }@

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      MinGW and MSVC compilers are not compatible, you should use the same compiler for compiling both projects (I am not sure whether you are doing that or not).

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        anand471
        wrote on last edited by
        #3

        Thanks for the reply.

        I am actually using Qt Creator 3.0.1 to compile both the projects. I hope QT Creator IDE uses MinGW compilers. Am I correct?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Most probably you are. You can check it in your project settings ("Project" panel on the keft hand side of Qt Creator window).

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ambershark
            wrote on last edited by
            #5

            I noticed the compile is trying to use a dll. If you are using qt creator and mingw then DLLs would be named as .so files and libs would be .a. So if it is trying to use a DLL inside of a mingw project it won't work, and would indeed say it couldn't find any symbols.

            Looks like what sierdzio said is happening and you are mixing 2 different compilers/binaries.

            My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

            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