468,780 Members | 2,264 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,780 developers. It's quick & easy.

Linking error in VC++ .NET 2003

My copy of VS .NET is Microsoft Development Environment 2003, Version 7.1.3088
Microsoft .NET Framework 1.1, Version 1.1.4322

I have a project (C++ Class Library) I originally wrote in VS .NET 2002. It worked then, and when I convert it to VS .NET 2003 and recompile, it works now.

The problem is creating new projects in VS .NET 2003.

If you have my version, try this:

Create a blank solution (I called it "Test").
Add a new C++ project (Class Library (.NET)); I called mine "LinkFault".

Here is LinkFault.h:
==========================================
// LinkFault.h

#pragma once

using namespace System;

namespace LinkFault
{
public __gc class Class1
{
static double foo( const double x );
};
}
==========================================
Here is LinkFault.cpp:
==========================================
// This is the main DLL file.
#include "StdAfx.h"

//#using <mscorlib.dll>
//using namespace System;

#include "LinkFault.h"

#include <cfloat>
#include <cmath>

double LinkFault::Class1::foo( const double x )
{
// LinkFault error LNK2001: unresolved external symbol "int __cdecl _finite(double)" (?_finite@@$$J0YAHN@Z)
if ( _finite( x ) ) {
// do something
}
// LinkFault error LNK2001: unresolved external symbol "int __cdecl _fpclass(double)" (?_fpclass@@$$J0YAHN@Z)
else if ( _fpclass( x ) == _FPCLASS_PINF ) {
// do something else
}
else if ( _fpclass( x ) == _FPCLASS_NINF ) {
// do something else
}

// LinkFault error LNK2001: unresolved external symbol "double __cdecl sqrt(double)" (?sqrt@@$$J0YANN@Z)
return sqrt( x );
}
==========================================
I have added comments indicating the kind of errors I get.

When I change from Debug mode to Release mode the "sqrt" link error disappears, but the others persist.

I am at my wits' end!
Nov 17 '05 #1
1 1297
Add "\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\msvcrt.lib" to the Property Pages--> Linker-->Command Line additional options

Why isn't that the default?
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by yanwan | last post: by
4 posts views Thread by Gary Hughes | last post: by
reply views Thread by Rudy Ray Moore | last post: by
reply views Thread by zhangrusi | last post: by
4 posts views Thread by Sanjay Kumar | last post: by
1 post views Thread by tomb | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.