Results 1 to 3 of 3

Thread: Using CCfits library in Win 7 with MSVC 2008

  1. #1
    Join Date
    Jul 2013
    Posts
    22
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Using CCfits library in Win 7 with MSVC 2008

    I'm trying to use the CCfits library in a Qt Creator project in Windows 7 32 bits. Please find the files appended.

    I builded the libs (CCfits depends on CFITSIO) from source and I actually can build and run a VS sample project which comes with CCfits, which is found in the cookbook folder of CCfits.

    The problem is how to run the same project on Qt Creator. I'm assuming that if it runs on VS it must be possible to run in Qt Creator (using the MSVC compiler).

    I installed the following packets:
    - Visual Studio Express 2008
    - qt-win-opensource-4.8.5-vs2008
    - Windows kit 8
    - qt-creator-windows-opensource-2.8.1

    The following is part of the compile output, which presents "already defined" issue:

    msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: unsigned short * __thiscall std::allocator<unsigned short>::allocate(unsigned int)" (?allocate@?$allocator@G@std@@QAEPAGI@Z) already defined in CCfits.lib(ColumnCreator.obj)
    msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: void __thiscall std::allocator<unsigned short>::deallocate(unsigned short *,unsigned int)" (?deallocate@?$allocator@G@std@@QAEXPAGI@Z) already defined in CCfits.lib(ColumnCreator.obj)
    release\CCfits-test.exe : fatal error LNK1169: one or more multiply defined symbols found
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.EXE"' : return code '0x491'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    13:36:24: The process "C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" exited with code 2.
    Error while building/deploying project CCfits-test (kit: MSVC2008)
    When executing step 'Make'
    I would like to ask how to procced in order to solve this problem. Any suggestion will be appreciated.

    Thanks in advance.

    CCfits-test.jpg

    CCfits-test.zip

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

    Default Re: Using CCfits library in Win 7 with MSVC 2008

    The error indicates that Microsoft's linker cannot link your third party source because of name clashes between symbols in CCFits.lib and the Microsoft C++ run time library. My guess is that your compiler command is missing an option (a preprocessor define in all likelihood) that adjusts the offending code in CcFits.

    This has no direct connection with Qt ( a library) or Qt Creator (an editor that can run make).

  3. #3
    Join Date
    Jul 2013
    Posts
    22
    Thanks
    10
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Using CCfits library in Win 7 with MSVC 2008

    Using jom instead of nmake, then I get the following:

    msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: unsigned short * __thiscall std::allocator<unsigned short>::allocate(unsigned int)" (?allocate@?$allocator@G@std@@QAEPAGI@Z) already defined in CCfits.lib(ColumnCreator.obj)
    msvcprt.lib(MSVCP90.dll) : error LNK2005: "public: void __thiscall std::allocator<unsigned short>::deallocate(unsigned short *,unsigned int)" (?deallocate@?$allocator@G@std@@QAEXPAGI@Z) already defined in CCfits.lib(ColumnCreator.obj)
    release\CCfits-test.exe : fatal error LNK1169: one or more multiply defined symbols found
    jom: C:\Users\Cristiano\Documents\QtProjects\CCfits-test\Makefile.Release [release\CCfits-test.exe] Error 1169
    jom: C:\Users\Cristiano\Documents\QtProjects\CCfits-test\Makefile [release] Error 2
    18:05:38: The process "C:\Qt\Qt5.1.0\Tools\QtCreator\bin\jom.exe" exited with code 2.
    Error while building/deploying project CCfits-test (kit: MSVC2008)
    When executing step 'Make'

    Added after 7 minutes:


    The following is the build log from Visual Studio. Could you guess something more from that...

    cookbook BuildLog c 13-10-2013 19-08-59.jpg

    Thanks in advance.


    Creating temporary file "c:\Users\Cristiano\Downloads\cookbook\Release\RSP 00000831204196.rsp" with contents
    [
    /O2 /Ob1 /I "C:\Users\Cristiano\Downloads" /I "C:\Users\Cristiano\Downloads\CCfits" /I "C:\CCfits" /I "C:\cfitsio" /D "WIN32" /D "NDEBUG" /D "_VC80_UPGRADE=0x0700" /D "_MBCS" /FD /EHsc /MD /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /c /Zi /TP /Zm500

    .\cookbook.cxx
    ]
    Creating command line "cl.exe @c:\Users\Cristiano\Downloads\cookbook\Release\RSP 00000831204196.rsp /nologo /errorReport:prompt"
    Creating temporary file "c:\Users\Cristiano\Downloads\cookbook\Release\RSP 00000931204196.rsp" with contents
    [
    /OUT:"Release/cookbook.exe" /INCREMENTAL:NO /LIBPATH:"C:\Users\Cristiano\Downloads\CCfits\vs.ne t\CCfits\Release" /LIBPATH:"C:\CCfits\vs.net\CCfits\Release" /LIBPATH:"C:\Users\Cristiano\Downloads\CCfits" /MANIFEST /MANIFESTFILE:"Release\cookbook.exe.intermediate.ma nifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"c:\Users\Cristiano\Downloads\cookbook\Release \cookbook.pdb" /DYNAMICBASE:NO CCfits.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    ".\Release\cookbook.obj"
    ]
    Creating command line "link.exe @c:\Users\Cristiano\Downloads\cookbook\Release\RSP 00000931204196.rsp /NOLOGO /ERRORREPORT:PROMPT"
    Creating temporary file "c:\Users\Cristiano\Downloads\cookbook\Release\RSP 00000A31204196.rsp" with contents
    [
    /outputresource:".\Release\cookbook.exe;#1" /manifest

    .\Release\cookbook.exe.intermediate.manifest
    ]
    Creating command line "mt.exe @c:\Users\Cristiano\Downloads\cookbook\Release\RSP 00000A31204196.rsp /nologo"
    Creating temporary file "c:\Users\Cristiano\Downloads\cookbook\Release\BAT 00000B31204196.bat" with contents
    [
    @echo Manifest resource last updated at %TIME% on %DATE% > .\Release\mt.dep
    ]
    Creating command line "c:\Users\Cristiano\Downloads\cookbook\Release\BAT 00000B31204196.bat"
    Last edited by vrltwe; 13th October 2013 at 23:13.

Similar Threads

  1. how to compile with msvc express 2008
    By john_god in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd March 2009, 14:09
  2. msvc++ 2008 express and msvc++ 2005 express
    By vonCZ in forum Installation and Deployment
    Replies: 4
    Last Post: 9th December 2008, 12:15
  3. Qt 4.4 OSE and MSVC 2008 problem
    By The Storm in forum Installation and Deployment
    Replies: 1
    Last Post: 26th June 2008, 22:55
  4. setting up qt 4.3.2 with msvc 2008/9.0
    By alloftheabove in forum Installation and Deployment
    Replies: 6
    Last Post: 5th February 2008, 06:25
  5. Qt Open source + MSVC++ 2008
    By TopFuel in forum Qt Programming
    Replies: 9
    Last Post: 6th October 2007, 19:09

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.