CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 1999
    Posts
    3

    COM-linking problem

    Hi!
    I've just made my first "real" COM-object.
    It works fine as long as I only make a debugversion of it. The problem is that I've included another project (that produces a .lib-file, not supporting MFC and only have Win32 Release or Win32 Debug to choose as build-settings).
    So when I choose Win32 Release MinDependency or
    MinSize, ofcourse I get a lot's of "unresolved exernals" when it's linking.
    How should I do it instead??
    Thanks a lot!


    Nilla

  2. #2
    Join Date
    Apr 1999
    Posts
    37

    Re: COM-linking problem

    Hi,
    You will get unresolved external linker errors if u are using imported functions without linking the
    lib which contains the imported symbols.my guess is that u have included this lib in the linker setings for the debug configuration but not for any other configuration.So select the release configuration and open the project settings dialog and choose the link tab and include this library file in the object/library modules
    edit box.make sure that this lib file is in the path where the system can find it.To make sure go the directories tab in the options dialog and include the directory which contains this lib.


  3. #3
    Join Date
    May 1999
    Posts
    3

    Re: COM-linking problem

    Hi Raj!
    Thanks for your answer, but I've allready linked to the .lib-file, and the unresolved externals look like they have to do with MFC.
    For ex:
    error LNK2005: "public: virtual __thiscall CObject::~CObject(void)" (??1CObject@@UAE@XZ) already defined in mfc42.lib(MFC42.DLL)
    ...and so on.
    It probalby has something with runtime-library or something to do, but my knowledge of these things are minimal..I just write code, dont know anything about what the machine does with it then..;-)
    Do you have any other suggestions what to do?
    Thanks,

    Nilla

  4. #4
    Join Date
    Apr 1999
    Posts
    37

    Re: COM-linking problem

    hi Nilla,
    are u building an ATL object with MFC support?can u send me the code which doesnt link([email protected]).i need more info.take care and bye
    -Raj


  5. #5
    Join Date
    May 1999
    Posts
    3

    Re: COM-linking problem

    I assume that you're using ATL to generate your COM object. Many times this has to do with usage of the C run-time library functions - I believe that some of the library functions are excluded under the min dependency setup. The first line of attack is to delete out the "_ATL_MIN_CRT" in your project settings. Then try to rebuild. There's more information on this if you look at MS-Article ID: Q165076. This applies to ATL 2.0/2.1 and works for 3.0 as well.


  6. #6
    Join Date
    May 1999
    Posts
    3

    Re: COM-linking problem

    srosemergy and Raj,
    Thanks for your help, somehow my problems disapeared and it was a good tip to get that
    article!
    Bye,

    Nilla

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured