472,141 Members | 1,295 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,141 software developers and data experts.

Static library and Dynamic library

3
Hi

I have static library that is created from VC++.Net, however, I would like to use it in Borland C++ and I do any ways but it is not successful. So I want to ask: by the way can I use static library in Borland C++? Or can I change the static library into dynamic library? If the second way can be, can you tell me the ways?

If any ways above cannot do, please show me another way. Thanks alot.

Any instructions and any ideas are very great! I hope I will get the feedback as soon as posible!
Oct 5 '07 #1
4 3587
weaknessforcats
9,208 Expert Mod 8TB
You cannot use a library created by VC++ in a Borland project.

Or, more generally, you cannpot use a library compiled with a different compiler from the one you are using.

The reason is the name mangling required by C++ to resolve function overloads into unique function names for the compiler and linker. The C++ standard requires mangling occur but the algorithm for the mangling is left to the mental fantasies of the compiler writer.

You just have to compile the dll using the Borland compiler and all will be well.

If that'snot possible, then you can't use Borland.
Oct 5 '07 #2
kukuta
3
Thank you for your advice!

Since I am using ipl98 library version 2.20 that it cannot compile in Borland C++. So I must compile it in VC++.Net. But you tell me that if I compile in VC++.net, i cannot use that dll outside .Net enviroment.

However, I want to use ipl98 library version 2.20 in Borland C++ that I cannot compile it in Borland C++, can you give me other advices? Have you been used ipl98 library yet? If you have the experience that please help me! Thank you very much!

I will wait your advices or instructions!

Best regards
kukuta
Oct 8 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
Since I am using ipl98 library version 2.20 that it cannot compile in Borland C++. So I must compile it in VC++.Net. But you tell me that if I compile in VC++.net, i cannot use that dll outside .Net enviroment.
Almost. What I said was a static library compiled by Visual Studio is generally not useable by another compiler, like Borland, due to name mangling.

Your orignal post referred to a static library.

DLLs are a little different. They are a relic from the C age of 1972 before C++ was invented. That means the function names in a dll must be unique. Like in C. So if the dll were compiled by Visual Studio, then it should be useable in Borland as long as its the same operating system.

However, do not expect a dll compiled using Windows to run on a Linux box.
Oct 8 '07 #4
kukuta
3
Hi weaknessforcats,

Thanks for your advices.

I means that if the dll or lib, which one I can use it in the Borland C++ is great. Since the ipl98 library version 2.20 cannot be compile in the Borland C++ successful(compiling successful but the dll and lib creating cannot run with example, it means unsuccessful compiling), so I must be compile ipl98 in the VC++.net to create dynamic library and static library. However, the dynamic library(dll) cannot run with the example of ipl98 library, just only static library(lib) can run with.

That is the reason I want to use static library in VC++.net to transition to dynamic library and after that using it in the Borland C++.

There are all what I want to ask you. Or you have another way to solve it. Please help me and give me emergency exit

How about is transition static library into dynamic library? This ways can we be successful?

Since I have no experience about dll and lib so I hope that you will show me step by step!

Thanks so much!

Best regards
Oct 9 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by iceColdFire | last post: by
1 post views Thread by Eduardo Suárez | last post: by
6 posts views Thread by Andrew S. Giles | last post: by
5 posts views Thread by meendar | last post: by
5 posts views Thread by info | last post: by
14 posts views Thread by Shimon Sim | last post: by
20 posts views Thread by JohnQ | last post: by
6 posts views Thread by Even | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.