News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Linker error with Microsoft Visual C++

Started by rem, January 23, 2006, 07:56:12 PM

Previous topic - Next topic

rem

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


Michael

#1
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
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

mandrav

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...

Michael

Yes, Mandrav is right. I have had some troubles too in the past. grv575 answer could be useful for you.

Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

rem

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.

Michael

Quote from: rem on January 24, 2006, 12:39:15 AM
I'm using 1.0rc2 version of codeblocks.

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

Quote from: rem on January 24, 2006, 12:39:15 AM
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?

Quote from: rem on January 24, 2006, 12:39:15 AM
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
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

rem

I installed microsoft platform sdk and Microsoft.NET SDK v2.0 but I cannot find msvcrt.lib or msvcrtd.lib there.


QuoteMay 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

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

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.

tiwag

#9
Quote
Do you need msvcrtd.lib to link your project?
you need it, if you want to build a debug version of your program.

QuoteDo you have this library?
yes ;-)

QuoteAnd 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

Michael

#10
Quote from: rem on January 25, 2006, 04:20:50 PM
Do you have this library?

Yes.

Quote from: rem on January 25, 2006, 04:20:50 PM
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
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

rem

I also have these libraries in the:

QuoteD:\Microsoft Platform SDK\Lib\AMD64

and
QuoteD:\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?