Results 1 to 5 of 5

Thread: Error linking a Win32 lib

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Error linking a Win32 lib

    Hi, I'm pretty new of the QT platform and I think it's great.

    I'm starting a project to use the EDSDK (from Canon) and I want to develop it for Win32 and MacOSX.
    So far I'm able to compile some simple classes on my Mac, but it's failing to link the link the lib on my WinXP

    This is my .pro file


    INCLUDEPATH += EDSDK/Header/

    win32 {
    DEFINES += _WIN32
    INCLUDEPATH += $$PWD/EDSDK/Win32/Library
    DEPENDPATH += $$PWD/EDSDK/Win32/Library
    LIBS += -L$$PWD/EDSDK/Win32/Library/ -lEDSDK
    PRE_TARGETDEPS += $$PWD/EDSDK/Win32/Library/EDSDK.lib
    }

    mac {
    DEFINES += __MACOS__
    INCLUDEPATH += $$PWD/EDSDK/MacOSX/Framework
    DEPENDPATH += $$PWD/EDSDK/MacOSX/Framework
    LIBS += -F$$PWD/EDSDK/MacOSX/Framework/ -framework EDSDK
    }


    and when I'm compiling using VS2008 I'm getting:


    16:55:39: Running build steps for project CanonController...
    16:55:39: Configuration unchanged, skipping qmake step.
    16:55:39: Starting: "D:\QtSDK\QtCreator\bin\jom.exe"
    D:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug
    cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -D_WIN32 -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"..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2008\include \QtCore" -I"..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2008\include \QtGui" -I"..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2008\include " -I"..\CanonController\EDSDK\Header" -I"..\CanonController\EDSDK\Win32\Library" -I"..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2008\include \ActiveQt" -I"debug" -I"." -I"..\CanonController" -I"." -I"..\..\..\QtSDK\Desktop\Qt\4.8.1\msvc2008\mkspecs \win32-msvc2008" -Fodebug\ @C:\DOCUME~1\Stefano\LOCALS~1\Temp\cameratablemode l.obj.3656.0.jom
    cameratablemodel.cpp
    d:\canon\me-canon\canoncontroller\cameratablemodel.h(4) : fatal error C1083: Cannot open type library file: 'd:\qtsdk\desktop\qt\4.8.1\msvc2008\include\qtcore \qabstractlistmodel': Error loading type library/DLL.

    mainwindow.cpp
    d:\canon\me-canon\canoncontroller\cameratablemodel.h(4) : fatal error C1083: Cannot open type library file: 'd:\qtsdk\desktop\qt\4.8.1\msvc2008\include\qtcore \qabstractlistmodel': Error loading type library/DLL.

    Generating Code...

    jom 1.0.6 - empower your cores


    jom 1.0.6 - empower your cores

    command failed with exit code 2
    command failed with exit code 2
    16:55:41: The process "D:\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
    Error while building project CanonController (target: Desktop)
    When executing build step 'Make'


    Any idea? it looks to me the generated makefile doesn't link the lib


    thank you

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Error linking a Win32 lib

    The error message indicates that the linker is being told that a header file is a library. This is bad.

    What is at/before d:\canon\me-canon\canoncontroller\cameratablemodel.h line 4, or before where that file is included in cameratablemodel.cpp/mainwindow.cpp?

  3. #3
    Join Date
    Sep 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Error linking a Win32 lib

    CanonController.zip

    this is my simple project, like I said before it does compile on my Mac (not this one since I've stripped out the framework)

    I really hope somebody can help, thanks in advance

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Error linking a Win32 lib

    Lines 4 and 5 of cameratablemodel.h should read:
    Qt Code:
    1. #include "EDSDK.h"
    2. #include <QAbstractListModel>
    To copy to clipboard, switch view to plain text mode 
    not "#import" which is a Microsoft extension related to linking COM libraries not inserting headers. Line 6 of main.cpp has the same problem.

    GCC has a deprecated #import pre-processor directive with different meaning (include-once). Objective C has an #import with the same meaning as GCC, which probably explains why it got past the OS X compiler.

  5. #5
    Join Date
    Sep 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Error linking a Win32 lib

    I knew it was a question for newbie, that fixed all my problems...

    thank you so much

Similar Threads

  1. Linking Error
    By amitpatel22 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 28th June 2011, 12:40
  2. Strange shell error (Qmake, Win32, MinGW)
    By tksharpless in forum Qt Tools
    Replies: 3
    Last Post: 20th November 2010, 19:35
  3. Linking error with QwtWeedingCurveFitter
    By dtakeshita in forum Qwt
    Replies: 0
    Last Post: 12th August 2010, 14:35
  4. Replies: 2
    Last Post: 31st October 2009, 03:41
  5. Sql module using error (Win32)
    By blackliteon in forum Qt Programming
    Replies: 1
    Last Post: 5th February 2006, 14:45

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
  •  
Qt is a trademark of The Qt Company.