Author Topic: Linker error with Microsoft Visual C++  (Read 11246 times)

rem

  • Guest
Linker error with Microsoft Visual C++
« on: January 23, 2006, 07:56:12 pm »
I'm using code blocks with Microsoft Visual C++ Toolkit 2003 on WinXP. I successfully compiled the wxWidgets libriaries but anytime I want to compile the simplest wxWidgets application I got this linker error:

LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'

I have no problems on compiling the same example with gcc and libriaries compiled with gcc. But with visual c++ I always fail.
What is wrong? Thanks for any help. rem


Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Linker error with Microsoft Visual C++
« Reply #1 on: January 23, 2006, 08:03:29 pm »
Hello,

Which C::B version are you using?

Did you download and install M$ SDK, and so on?

[EDIT] Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE

Best wishes,
Michael
« Last Edit: January 23, 2006, 08:06:53 pm by Michael »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Linker error with Microsoft Visual C++
« Reply #2 on: January 23, 2006, 08:07:59 pm »
Microsoft Visual C++ Toolkit 2003 does not contain the debug libraries.
'MSVCRTD.lib', from what I can understand, is the debug version of 'MSVCRT.lib' which obviously you don't have...
Be patient!
This bug will be fixed soon...

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Linker error with Microsoft Visual C++
« Reply #3 on: January 23, 2006, 08:19:49 pm »
Yes, Mandrav is right. I have had some troubles too in the past. grv575 answer could be useful for you.

Michael

rem

  • Guest
Re: Linker error with Microsoft Visual C++
« Reply #4 on: January 24, 2006, 12:39:15 am »
I'm using 1.0rc2 version of codeblocks. I have installed sdk and I have msvcrtd.lib but not for my machine X86, there is only library for amd64 and IA64. It is strange because I have this error even when I'm trying to compile this example without debugging symbols.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Linker error with Microsoft Visual C++
« Reply #5 on: January 24, 2006, 10:18:15 am »
I'm using 1.0rc2 version of codeblocks.

Try a nightly build and see if it goes better for you.

I have installed sdk and I have msvcrtd.lib but not for my machine X86, there is only library for amd64 and IA64.

Then your library will probably not work on x86 (but I may be wrong). Did you try grv575 answer?

It is strange because I have this error even when I'm trying to compile this example without debugging symbols.

May be you have set to use debugging symbols in the global compiler options. And then even if you not select debugging symbols in project compiler options, it will be inherit from the global compiler options.

Michael

rem

  • Guest
Re: Linker error with Microsoft Visual C++
« Reply #6 on: January 25, 2006, 04:08:03 pm »
I installed microsoft platform sdk and Microsoft.NET SDK v2.0 but I cannot find msvcrt.lib or msvcrtd.lib there.


Quote
May be you have set to use debugging symbols in the global compiler options. And then even if you not select debugging symbols in project compiler options, it will be inherit from the global compiler options.

I have set not to use debugging symbols in the global compiler options and project compiler options but still I the linker needs the msvcrtd.lib. And I have no idea why and where to get this library.

rem

  • Guest
Re: Linker error with Microsoft Visual C++
« Reply #7 on: January 25, 2006, 04:10:25 pm »
In the article "Integrating Microsoft Visual Toolkit 2003 with Code::Blocks IDE" I found this note:

Quote
-H2: If the project you are compiling complains that it cannot find "msvcrt.lib" then download the .NET 1.1 SDK and add to the END of the Directories->Linker tab:

C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib

Both the VC++ Toolkit 2003 and the platform SDK omit this library.

But in the .NET 1.1 SDK I haven't found this library or .NET 2.0 SDK either.

rem

  • Guest
Re: Linker error with Microsoft Visual C++
« Reply #8 on: January 25, 2006, 04:20:50 pm »
I have a question to those who are using microsoft visual c++ toolkit 2003. Do you need msvcrtd.lib to link your project? Do you have this library? And where is it? Thanks for any advice, rem.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Linker error with Microsoft Visual C++
« Reply #9 on: January 25, 2006, 04:35:18 pm »
Quote
Do you need msvcrtd.lib to link your project?
you need it, if you want to build a debug version of your program.

Quote
Do you have this library?
yes ;-)

Quote
And where is it? Thanks for any advice, rem.
it is part of the Visual C (or Studio) but not part of the free toolkit - it is generally NOT freely available
« Last Edit: January 25, 2006, 04:37:38 pm by tiwag »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Linker error with Microsoft Visual C++
« Reply #10 on: January 25, 2006, 05:00:58 pm »
Do you have this library?

Yes.

And where is it?

I have both msvcrtd.lib and msvcrt.lib under:

Quote
Microsoft Platform SDK\Lib\IA64

and

Quote
Microsoft Platform SDK\Lib\AMD64

[EDIT] I have no tried those libraries until now. So, I am not sure if they work or not.

Michael
« Last Edit: January 25, 2006, 05:19:42 pm by Michael »

rem

  • Guest
Re: Linker error with Microsoft Visual C++
« Reply #11 on: January 25, 2006, 11:13:04 pm »
I also have these libraries in the:

Quote
D:\Microsoft Platform SDK\Lib\AMD64

and
Quote
D:\Microsoft Platform SDK\Lib\IA64

directories. But I need for X86 not amd64 or ia64 machine, so for me these libraries are useless. I also unset produce debugging symbols in the compiler options and the linker stil show the same error:

LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib'

So I really don't know what is going on. Are there libs for X86?