473,719 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Static library and Dynamic library

3 New Member

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 3701
9,208 Recognized Expert Moderator Expert
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
3 New Member
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
Oct 8 '07 #3
9,208 Recognized Expert Moderator Expert
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
3 New Member
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(comp iling 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

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

Similar topics

by: iceColdFire | last post by:
Hi, Can someone highlight the difference between static library and bynamic library...and how do .lib and .dll files come up in the picture... Thanks, a.a.cpp++ :-)
by: Eduardo Suárez | last post by:
Hi, i have tried to understand how static variables work on a dynamic library, but there's a point i can't see. * Is the data segment (where static variables live, please confirm) copied for every binary that is running linked to the library? This is what it seems from my own experiments. That is, there is a copy of every static variable for every binary linked. Then, is it really useful the library?
by: Andrew S. Giles | last post by:
Is it possible to bring in a static library (developed in C++) into a C# project/solution? Thanks in advance for any information. Andrew S. GIles
by: meendar | last post by:
can anyone tell me what the static and dynamic library? thnkx in advance.
by: info | last post by:
Hi! Please be patient with a newbie... I use DevC++. I've found and compiled succefully various openGL examples. Before build the application, I link the project with static libs, like, in example, libglut32.a. The executables running fine, but if I try them on a system without glut32.dll, they don't start.
by: Shimon Sim | last post by:
I have a static variable defined something like this private static Dictionary<string, string> roles = new Dictionary<string,string>(); Can I safely assume that it will be live for the live of application? Meaning that any thread/page of the application will have access to the data in this variable.
by: JohnQ | last post by:
The way I understand the startup of a C++ program is: A.) The stuff that happens before the entry point. B.) The stuff that happens between the entry point and the calling of main(). C.) main(). So, if the above is OK, does static initialization occur during A or B? What happens during A?
by: sealo | last post by:
Hello, I have a test in VS2005 that static library A.lib use the dynamic library C.dll. Then a application App use the A.lib. App-->A.lib-->C.dll It works. But if I remove the C.dll, the app tell me can not find the C.dll. I think because A.lib is a static library, so it should contain the
by: Even | last post by:
Hi all, As far as I know, relative address will be assigned by program at link time.Right? Ok, here we go. So if we use a static library, it will give the program an relative address(i mean the function address) at link time. Also the code of the library will load into the program. Go on. Now if we use a dynamic library, what it will give the program?
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.