Click to See Complete Forum and Search --> : COM-linking problem
nilla
May 18th, 1999, 09:41 AM
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
RajM
May 18th, 1999, 05:07 PM
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.
nilla
May 19th, 1999, 04:08 AM
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
RajM
May 19th, 1999, 12:21 PM
hi Nilla,
are u building an ATL object with MFC support?can u send me the code which doesnt link(MohanR@bsci.com).i need more info.take care and bye
-Raj
srosemergy
May 19th, 1999, 03:08 PM
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.
nilla
May 20th, 1999, 03:28 AM
srosemergy and Raj,
Thanks for your help, somehow my problems disapeared and it was a good tip to get that
article!
Bye,
Nilla
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.