Solved

A static library's library??

Posted on 2000-02-14
3
489 Views
Last Modified: 2013-12-14
Suppose I have a static library (which I actually happen to have). And I don't want to change that library, because I like it the way it is. This library is used by a console application, and works fine.

What I want to do now, is to make another static library, which contains the code in the application mentioned above, except that I will alter it to not print anything to standard out, but instead return information to the caller. The static library need to be linked with another static library. Is this possible??

Can I make a static library that needs functions from a static library? If so, how do I do it?

I am using VC++6.0 Enterprise Edition.
0
Comment
Question by:lar_jens
3 Comments
 
LVL 1

Accepted Solution

by:
chytrace earned 100 total points
ID: 2518292
Hi,
     I think you can only make a new library with additional calls or classes you need and link your application against both. But this implies that your application code must at some point decide which calls will be used from which library.
The second possbility could be to turn your exisisting library into DLL
and build the new library as DLL as well and to switch between them in run-time dynamically according to your needs. In this case you don't have to change your application's code if the DLL calls have the same signature. With DLLs you must export the symbols you want to use in your application and in your application's code you must import them.
This you can do in DLL header files. More info about bulding DLLs you can fine in the MSDN on-line documenation or its Web version
http://msdn.microsoft.com

Hope this helps

Radovan
0
 
LVL 22

Expert Comment

by:nietod
ID: 2518431
When you create _your_ static library, just make sure this other static library is linked to it.  i.e. include this other library in the project's workspace.  Then make sure that your library does not export anything that is exported from the other library.  i.e the headers you write for your library should not mention any procedures or data types exported from the other library, only the ones exported from you library.  I think that in that case, you will not nead to link programs that use your library with the other library.  try it.
0
 
LVL 1

Author Comment

by:lar_jens
ID: 2530782
Thank you..
I didn't realize it was that simple, but it really is.. =)

I made two static libraries, and linked my new app with both, and I made myself a new header file that just told my app what the functions was named.. And of course, I had no naming conflicts.

Cool..!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question