BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Static Library Linking Problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE)
View previous topic :: View next topic  
Author Message
Mark .
Guest





PostPosted: Wed Apr 07, 2004 2:11 pm    Post subject: Static Library Linking Problem Reply with quote



I am attempting to use C++ Builder 5 as a test bed for some embedded C code that I have developed. I am trying to create a static library in builder, which will mimic the structure in my embedded application. The problem is I can’t manage to link my Borland created static library into my Borland built test application. See error below:

[Linker Error] Unresolved external 'Int_To_BCD(int)' referenced from C:TEMPDELETEITTESTUTIL.OBJ

Details:
I created the library using the Borland File->New-> Library wizard and all default options unchanged. The only modifications I made was generating a list file to verify the library was created (which does appear correct). So no problem here.

I created an application to test this library in Builder, copied the library and it’s header file to the test application directory, added the library (util.lib) to my project manager, and included the library’s header file to where I’m calling it’s (util.lib) routines. The test application (project options) also uses all default values. I have tried all of the different functions in the library file, but I get the same type of Linker Error with every one. I than had the project generate a map file, and the library does not appear in the memory map?

Any input would be greatly appreciated.
Disclaimer: Function Names have been changed to protect the innocent ;-)

Thanks,
Mark

Back to top
Ed Mulroy [TeamB]
Guest





PostPosted: Wed Apr 07, 2004 5:16 pm    Post subject: Re: Static Library Linking Problem Reply with quote



Quote:
Disclaimer: Function Names have been changed to protect
the innocent Wink

You will not show the actual function header used in the library and
the function prototype used by the source code that uses the library.
One hits few targets when shooting in the dark.

A guess is that the function is decorated with extern "C" WINAPI or
extern "C" __stdcall in the source code but was not so decorated in
the library source code.

Look at the function prototype for that function in the library's
header file that is used in the source code which uses the library
versus that used in the source code for the library itself.

If you run this

tdump -m filename.obj | find "Int_To_BCD"

for each of the object file that uses the library and the library
object file which contains the function I think you will see a
difference in the names.

If you do not have the object file for the item in the library, you
can create one with this command:

tlib /C util.lib *filename.obj

.. Ed

Quote:
Mark wrote in message
news:4073fdf0$1 (AT) newsgroups (DOT) borland.com...

... C++ Builder 5 ... I am trying to create a static library ...
I can’t manage to link my Borland created static library
into my Borland built test application. ...

[Linker Error] Unresolved external 'Int_To_BCD(int)'
referenced from C:TEMPDELETEITTESTUTIL.OBJ

I created the library using the Borland File->New-> Library
wizard and all default options unchanged. The only modifications
I made was generating a list file to verify the library was created
(which does appear correct). So no problem here.

I created an application to test this library in Builder, copied the
library and it’s header file to the test application directory,
added
the library (util.lib) to my project manager, and included the
library’s
header file to where I’m calling it’s (util.lib) routines. The test
application (project options) also uses all default values. I have
tried all of the different functions in the library file, but I get
the same
type of Linker Error with every one. I than had the project
generate
a map file, and the library does not appear in the memory map?

Any input would be greatly appreciated.
Disclaimer: Function Names have been changed to protect the
innocent Wink



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.