×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    7

    CodeWarrior linker issue: How to include a 3rd party static library into my DLL build

    Hi,

    I am sorry if a post with similar subject has been made earlier. I would appreciate if you could please send pointers to that post.

    I am currently porting a 3rd party provided win32 library (say ThirdPartyLib.lib) onto Series60 WINSCW UDEB target. I think that this is a static library because there is no DLL provided along with this lib
    file.

    My Engine component has TARGETTYPE DLL and it tries to import this 3rd party
    lib as STATICLIBRARY. The MMP structure is as below:
    ------------------------------------------------
    TARGET MyEngine.dll
    TARGETTYPE dll
    UID 0x1000008d 0x12345678
    ...
    //LIBRARY ThirdPartyLib.lib
    // No change in behaviour if LIBRARY above
    // is uncommented and STATICLIBRARY below is commented
    STATICLIBRARY ThirdPartyLib.lib
    LIBRARY EUser.lib EFSRV.lib EStLib.lib
    ------------------------------------------------

    When I build (abld build winscw udeb) I get linker errors on methods called into ThirdPartyLib.lib thats says as below
    ------------------------------------------------
    mwldsym2.exe: Undefined symbol: '__declspec(dllimport)
    _somemethod(__imp__somemethod)'
    mwldsym2.exe: Note: symbol '_somemethod' found in ThirdPartyLib.lib';
    "mwldsym2.exe: your project may need the DLL import library instead of
    a static library"
    ------------------------------------------------

    If I change the TARGETTYPE to LIB then the WINSCW platform build goes fine but I want the TARGETTYPE to be DLL..
    Also, this same MMP setup (i.e., with TARGETTYPE DLL entry) works fine with WINS platform builds.

    Can you kindly point out how this can be solved for WINSCW.

    -Thanks, Hari

  2. #2
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    328
    You are going to need the .DLL.

    For a statically linked dll, you will also need the associated .LIB file at build time.

    It sounds like you are missing a few things? Do you have the source for the 3rd party lib? If so you can generate all the required files yourself...

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    7
    Thanks for the reply.
    The problem is we do not have access to the source code of the 3rd party Libraries. And also, they are provided as LIBs (.lib) only.
    But the same setup works with WINS builds. That is I am able to statically link the 3rd party .lib and build my library as a .dll.
    So is it so that this is an issue with CodeWarrior itself?

  4. #4
    Regular Contributor
    Join Date
    Feb 2005
    Posts
    328
    Do you have .LIB files for WINSCW and WINS or just WINS?
    because they are different...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •