using pvrtc lib

This topic contains 2 replies, has 2 voices, and was last updated by  Deep 6 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30409

    Deep
    Member

    I’m trying to use the pvrtc texture compression library.  When I use the DLL version (UtilitiesPVRTCdll) everything compiles and works correctly, however, I’d like to avoid the external dependency.  When I try to link w/ the lib version (UtilitiesPVRTClib), however, I get the following errors:

     1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __malloc_dbg already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __free_dbg already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(tidtable.obj) : error LNK2005: __encoded_null already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj)
    1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj)
    1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj)
    1>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj)
    1>LIBCMTD.lib(hooks.obj) : error LNK2005: “void __cdecl terminate(void)” (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(vsprintf.obj) : error LNK2005: _vsprintf already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(_ctype.obj) : error LNK2005: _isspace already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(printf.obj) : error LNK2005: _printf already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(tolower.obj) : error LNK2005: _tolower already defined in MSVCRTD.lib(MSVCR90D.dll)
    1>LIBCMTD.lib(vprintf.obj) : error LNK2005: _vprintf already defined in MSVCRTD.lib(MSVCR90D.dll)

    I tried to ignore libcmtd.lib, but then I get the following errors instead:

    1>pvrtc.lib(tools.obj) : error LNK2019: unresolved external symbol __iob referenced in function _printf_flush
    1>pvrtc.lib(bitmap.obj) : error LNK2001: unresolved external symbol __iob
    1>pvrtc.lib(amtc.obj) : error LNK2001: unresolved external symbol __iob

    I’m guessing these errors are a result of mixing debug and release libraries or libraries compiled w/ another version of Visual Studio.  I’m trying to build a debug version of my application, which uses the Multi-threaded Debug DLL, using Visual Studio 2008.

    Can someone provide some details about what options were used to create the lib version of pvrtc?  Assuming there is an incompatibility, is it possible to get a new library built w/ VS 2008?

    Is dll version of pvrtc built w/ the same compiler options as the lib version?  I’m a little confused as to why the dll version works while the lib version doesn’t.

    #34663

    This happens because you try to link with a runtime different than the pvrtc lib.

    In MSVC, in project options under C/C++ -> Code Generation -> Runtime Library.

    Try all the values until it works 🙂

    #34664

    Deep
    Member

    While that may be informative, I’m working w/ a very large code base that links w/ other 3rd components, so changing the version of the C runtime I use is not an option.

    While I understand the desire to not expose the source to the pvrtc library, if you’re going to do that you should ship the SDK w/ several (documented) versions of the library in an effort to  maximize the potential that the library could actually be used.

    Is it possible to get another build of this library?

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.