15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Statically linking MFC in OCX's

David Evans -- evs@sonacomm.com
Thursday, March 06, 1997

Environment: VC++  4.2b, Win95, NT4.0

I'm trying to create an ocx that uses MFC with static linking.  I've =
tried creating a new MFC OCX project using the ApplicationWizard, and =
setting the general property to use static linking with MFC.  Compiling =
produces a long list of missing external definitions:

Linking...
   Creating library Release/SLink.lib and object Release/SLink.exp
SLink.obj : error LNK2001: unresolved external symbol "public: virtual =
int __thiscall =
COleControlModule::ExitInstance(void)"(?ExitInstance@COleControlModule@@U=
AEHXZ)
SLink.obj : error LNK2001: unresolved external symbol "public: virtual =
int __thiscall =
COleControlModule::InitInstance(void)"(?InitInstance@COleControlModule@@U=
AEHXZ)
...
SLinkPpg.obj : error LNK2001: unresolved external symbol "public: =
__thiscall COlePropertyPage::COlePropertyPage(unsigned int,unsigned =
int)"(??0COlePropertyPage@@QAE@II@Z)
SLinkPpg.obj : error LNK2001: unresolved external symbol "void __stdcall =
DDP_PostProcessing(class CDataExchange =
*)"(?DDP_PostProcessing@@YGXPAVCDataExchange@@@Z)
Release/SLink.ocx : fatal error LNK1120: 113 unresolved externals
Error executing link.exe.

I've tried adding these files to the links libraries: mfc42.lib =
mfcn42d.lib mfco42d.lib msvcrt.lib=20

With this, I get:

Linking...
SLink.def : error LNK2001: unresolved external symbol DllCanUnloadNow
SLink.def : error LNK2001: unresolved external symbol DllGetClassObject
Release/SLink.lib : fatal error LNK1120: 2 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file

Is there a way to create an ocx that links statically with MFC?

Thanks much for any suggestions,

--- Dave
evs@sonacomm.com




Mike Blaszczak -- mikeblas@nwlink.com
Saturday, March 08, 1997

At 12:31 3/6/97 -0500, David Evans wrote:
>Environment: VC++  4.2b, Win95, NT4.0

>I'm trying to create an ocx that uses MFC with static linking. 

You can't.  It won't work.  It's not even worth trying.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.





Become an MFC-L member | Вернуться в корень Архива |