You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Arjen van Muyen <Ar...@pica.nl> on 2001/02/19 17:25:57 UTC

Linker Problems: error LNK2001: unresolved external symbol "

Some problems occured when I tried to link the Xerces parser with a make
file outside Micosoft Visual C++. Link produced the following error-message:

	error LNK2001: unresolved external symbol "__declspec(dllimport)
publi
	c: static void __stdcall XMLPlatformUtils::Initialize(void)"
(also for Terminate() )

I included the xerces-c_1D.lib, that is not the problem. MSDN Library
mentions:
"Functions declared with the static modifier by definition have file scope.
Static variables have the same limitation. Trying to access any static
variables from outside of the file in which they are declared can result in
a compile error or LNK2001."
Initialize and Terminate are declared with the static modifier, is this the
problem ?

Do you have any suggestions?

A.E. van Muyen
arjenvan.muyen@pica.nl

Re: Linker Problems: error LNK2001: unresolved external symbol "

Posted by Dean Roddey <dr...@charmedquark.com>.
Static at file scope and static at class scope are two different things.
Clearly a gazzillion other people are using the parser and have to call
init/term to do this, so there probably cannot be any such problem inherent
in the libraries. You are just doing something incorrectly. I assume you are
not defining any of the PROJ_XXX type stuff in your compile line, are you?
Those should only be defined when building the parser itself.

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"We're gonna need a bigger boat"


----- Original Message -----
From: "Arjen van Muyen" <Ar...@pica.nl>
To: <xe...@xml.apache.org>
Sent: Monday, February 19, 2001 8:25 AM
Subject: Linker Problems: error LNK2001: unresolved external symbol "


> Some problems occured when I tried to link the Xerces parser with a make
> file outside Micosoft Visual C++. Link produced the following
error-message:
>
> error LNK2001: unresolved external symbol "__declspec(dllimport)
> publi
> c: static void __stdcall XMLPlatformUtils::Initialize(void)"
> (also for Terminate() )
>
> I included the xerces-c_1D.lib, that is not the problem. MSDN Library
> mentions:
> "Functions declared with the static modifier by definition have file
scope.
> Static variables have the same limitation. Trying to access any static
> variables from outside of the file in which they are declared can result
in
> a compile error or LNK2001."
> Initialize and Terminate are declared with the static modifier, is this
the
> problem ?
>
> Do you have any suggestions?
>
> A.E. van Muyen
> arjenvan.muyen@pica.nl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>