tags:

views:

512

answers:

2

I am using the MFC class CSocket. Nothing complicated - open a connection to a server and send a short message. The code works fine when I link with MFC in a DLL. However, the call to CSocket::Create() crashes when I link to MFC in a static library.

I would like to use MFC in a static library since it simplifies distribution.

A: 

This rings a dim and distant bell - what version of MFC are you using?

Rob
A: 

Are you getting any linker warnings at all? Make sure you link the right CRT library depending on your "Code Generation" setting. For Multi-threaded static, you need libcmt.lib for release (libcmtd.lib for debug), also make sure _AFXDLL isn't defined.

Lou Franco
No linker warnings.
ravenspoint