473,729 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Static library contain dynamic library

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
C.dll in it during the build. But actually, it doesn't.
Is there some method to make A.lib contain C.dll, but do not need to
deliver both?

Jun 26 '07 #1
4 1974
"sealo" <se*****@gmail. comwrote in message
news:11******** **************@ o11g2000prd.goo glegroups.com.. .
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
C.dll in it during the build. But actually, it doesn't.
Is there some method to make A.lib contain C.dll, but do not need to
deliver both?
No, you can not morph a dynamic load library into a static library. Of
course if you have the source to C you can include it in A and recompile it
into the static library.

Regards,
Will
www.ivrforbeginners.com
Jun 26 '07 #2

"sealo" <se*****@gmail. comwrote in message
news:11******** **************@ o11g2000prd.goo glegroups.com.. .
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
C.dll in it during the build. But actually, it doesn't.
Is there some method to make A.lib contain C.dll, but do not need to
deliver both?
Not unless you have source code for C.dll. A lot of information is stripped
during the linking process (where different functions begin and end, for
instance).

Jun 26 '07 #3
On Jun 26, 10:02 am, "Ben Voigt [C++ MVP]" <r...@nospam.no spamwrote:
"sealo" <seah...@gmail. comwrote in message

news:11******** **************@ o11g2000prd.goo glegroups.com.. .
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
C.dll in it during the build. But actually, it doesn't.
Is there some method to make A.lib contain C.dll, but do not need to
deliver both?

Not unless you have source code for C.dll. A lot of information is stripped
during the linking process (where different functions begin and end, for
instance).
I have the source of C. So, the only method is to recompile the C into
static lib. Then rebuild A.lib

Jun 26 '07 #4
"sealo" <se*****@gmail. comwrote in message
news:11******** **************@ z28g2000prd.goo glegroups.com.. .
I have the source of C. So, the only method is to recompile the C into
static lib. Then rebuild A.lib
Yup.

Regards,
Will
Jun 26 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2324
by: jr | last post by:
I am working in VC++ so this may be microsoft specific though I don't think so. Excuse me if it is. Assuming it isn't, can someone generally explain the purpose of having both - is it purely a deployment/distribution thing. I notice that the static library generates obj files and a Lib file. Could someone kindly explain how they relate to one another. Thanks very much
1
6964
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?
8
3686
by: Peter B. Steiger | last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C is a simple word game that involves stringing together random lists of words. In the Pascal version the whole array was static; if the input file contained more than entries, tough. This time I want to do it right - use a dynamic array that increases in size with each word read from the file. A few test programs that make use of **List and realloc( List, blah...
3
1130
by: Joel Barsotti | last post by:
What I mean here is that I have to build an HTML interface for a CD catalouge. All the contents for this catalouge are in a DB right now for the current ..net website. Since the CD catalouge will contain 200 plus elements I'd like to leverage the DB to help create the content for the CD, but at the same time thinks like extensions and names would be very very different.
5
5096
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.
14
17826
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.
20
6090
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?
6
5618
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?
6
7972
by: =?ISO-8859-1?Q?Tim_B=FCthe?= | last post by:
Hi, we are building a Java webapplication using JSF, running on websphere, querying a DB2 9 on Suse Enterprise 10. The app uses JDBC and PreparedStatements only (aka dynamic SQL). Every night, there is a ETL which deletes most of the data in the database and fills it all new. We observed very bad performance for some statements that ran for minutes (The queried table is about 100,000 records and the result is about 500 rows)....
0
8917
marktang
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...
0
9281
jinu1996
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...
1
9200
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,...
1
6722
isladogs
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...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
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...
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.