For Programmers: Free Programming Magazines  


Home > Archive > Visual Studio > May 2006 > linking problems with 3rd party .lib









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author linking problems with 3rd party .lib
mblatch

2006-05-20, 7:03 pm

I have a library provided by a third party with functions I need access
to. I include their prototypes in my app, but the thing won't link:
gives me an unresolved external symbol, but the library is definitely
being checked.

Their supplied function prototype:
int test1(double x[],double y[],int &i, int &j, double c[], int c_i[]);

When I use function:
int status;
double *x;
double *y;
int i;
int j;
double *c;
int *c_i;
status=test1(x,y,i,j,c,c_i);

Linker error:
Error 7 error LNK2019: unresolved external symbol "int __cdecl
test1(double * const,double * const,int &,int &,double * const,int *
const)" (?test1@@YAHQAN0AAH10QAH@Z) referenced in function
_main TEST.obj

I did a "lib -list" on the external library and see the following:

?test1@@YAHQAN0AAH10QAH0@Z.................................\obj\d_test1.obj

Of interest is the additional "0" that shows up at the end of the
definition in the library. I'm guessing this is indicative that the
prototype they gave me is not exactly the same as how it was built, but
they claim everything's o.k. Is there a way of decoding these cyptic
library definitions to see what the argument types are?

Also has been suggested that they built the library with MS Visual C++
13 and I am using MS Visual Studio 2005. I would have expected
libraries to be a little more portable that that.

Thanks,Mike

Phil Cairns

2006-05-21, 7:07 pm

mblatch wrote:
[snip]
> ?test1@@YAHQAN0AAH10QAH0@Z.................................\obj\d_test1.obj
>
> Of interest is the additional "0" that shows up at the end of the
> definition in the library. I'm guessing this is indicative that the
> prototype they gave me is not exactly the same as how it was built, but
> they claim everything's o.k. Is there a way of decoding these cyptic
> library definitions to see what the argument types are?


Check out these links:
http://en.wikipedia.org/wiki/Name_mangling
http://www.kegel.com/mangle.html
http://sparcs.kaist.ac.kr/~tokigun/....html#Microsoft

Phil
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com