Noel Mosa wrote:
Hi, thanks for the quick response,
>>lets say a variable is called "dummy" then the linker gives an error
that it cant find "_dummy".
Do you provide the module in which that variable is *defined* to the
linker?
like i said it is a already compiled library. I do provide the "lib"
files though. I also have the source code but the program is linked
against the libs.
Unfortunately it's a problem outside of the _language_ area of concern.
Libraries are platform- and compiler-specific.
>I am not sure what "tweak the linker" means. What can you tweak in
your linker? Isn't it just a program which you run?
I meant for example adding options or switches...
We don't know about those. C++ doesn't define them (I don't mean to
sound dismissive but that's just how it is).
Maybe theres a switch that tells the linker something like:
"Hey buddy, the variable is declared in the library i gave you! look
in there!"
Maybe. In most cases, a reference to that variable and the extern
declaration should be sufficient so that the compiler produces certain
instructions to the linker what needs to be resolved, and then you
give the linker enough information as to where to find those objects.
It sounds like you have done all that.
>
I am writing this in visual studio and am going to ask in that group
too.
Good idea.
So do you think, from the language point of view, declaring the
variable as: extern "C" extern someClasstype dummy*;
is enough?
Well, yes. Only it should probably be
extern "C" someClasstype* dummy;
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask