Author Topic: Linking error to MFC libs  (Read 7646 times)

drepster

  • Guest
Linking error to MFC libs
« on: February 15, 2006, 08:40:26 am »
Hi,

I am using codeblocks together with the Visual C++ toolkit compiler and I have installed the Microsoft Platform SDK.

I am trying to compile a program which uses an MFC class (CString). I have included the afx.h header which is provided by the Platform SDK in the include\mfc directory. When I build my app I get an error saying:
LINK : fatal error LNK1104: cannot open file 'nafxcw.lib'

I have done some research and from what I can understand the mfc libs are not distributed with the platform sdk and you cannot link to them statically. Instead, for people using Visual C++ they recommend checking a checkbox which says: 'Use MFC in a Shared DLL'.

I am a bit of a newbie so my questions my be a bit obvious but here they are:
- can I compile a app using precompiles DLL's. i.e. I don't need the .Lib file necessarily?
- If so how do I configure codeblock to link against a dll rather than looking for the .lib file
- Last where is the mfc shared dll?

thanks in advance
cheers
andre

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Linking error to MFC libs
« Reply #1 on: February 15, 2006, 08:51:41 am »
MFC is not supported by the free toolkit. Period.
Even if you could make it work by copying libraries and DLLs from an existing VisualStudio installation, it would be illegal...
Be patient!
This bug will be fixed soon...

sethjackson

  • Guest
Re: Linking error to MFC libs
« Reply #2 on: February 15, 2006, 05:07:41 pm »
Let me say you could use wxWidgets.  :D

http://www.wxwidgets.org/

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Linking error to MFC libs
« Reply #3 on: February 15, 2006, 06:00:10 pm »
Hello,

This link could be useful:

http://www.wxwidgets.org/wiki/index.php/WxWidgets_For_MFC_Programmers

Best wishes,
Michael

drepster

  • Guest
Re: Linking error to MFC libs
« Reply #4 on: February 16, 2006, 12:44:00 am »
Thanks for the replies. Saves me time fighting trying to get the thing to compile.

I am going to take you suggestion and try my luck with wxWidgets. Sounds like wxString will do the job.


thanks again
andre