Click to See Complete Forum and Search --> : unresolved external symbol


rowgram
November 7th, 2005, 05:34 PM
I have .NET app that compiles but has a problem during linking :

error LNK2001: unresolved external symbol "int __cdecl ReadLn(struct _iobuf *,char * const)" (?ReadLn@@$$FYAHPAU_iobuf@@QAD@Z)

The ReadLn function prototype is defined in a header file
& is called in another header file.
My compiler options are set to /Gd & /Tp.

If I don not call the function (& just have it's prototype declared),
then the program links fine.

When I try to resolve the ambiguity by explicitly calling the function
like namespace::function, I get an error saying that function is not a
member of namespace. This puzzles me since everywhere I look
(Classe View, Intellisense, Context Help) recognizes function as
a member of the namespace.

Why is the linker confused on this function ?

Regards,
ak

cilu
November 7th, 2005, 06:01 PM
Are you use that the function prototype declared in your header and the one from the LIB file are an exact match?

rowgram
November 8th, 2005, 10:18 AM
There doesn't seem to be a lib file associated with the project - am I supposed to create one ?

ak

rowgram
November 8th, 2005, 10:21 AM
One more thing - attached is a scaled down version of my program that still shows the linker error on the function ReadLn.
Hope this helps - I'm not sure on the cause ?

ak

rowgram
November 8th, 2005, 04:04 PM
I found out the issue : the function prototype was not defined within the same namespace as the function call.

ak