C++ library in C


 
Thread Tools Search this Thread
Top Forums Programming C++ library in C
# 1  
Old 12-24-2008
C++ library in C

Hi,

I have a bunch of C++ files whose functionality needs to be included in another piece of C code. Is it possible to create a C++ library and link it with C code?
# 2  
Old 12-27-2008
Quote:
Originally Posted by smanu
Hi,

I have a bunch of C++ files whose functionality needs to be included in another piece of C code. Is it possible to create a C++ library and link it with C code?
you call compile as a dll, call it by dlopen dlsym
# 3  
Old 12-29-2008
It is possible but there are a lot of caveats. Here is a pointer to an article on SDN which discussing how to mix C and C++ code and libraries on Solaris but the principles apply to any OS.
Mixing C and C++ Code in the Same Program
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Programming

C++ linking library to a library

Hi All, My application main engine will use a shared library where we do many operation. We are trying to implement the linear algebra operation on the shared library for that I need to link my shared library to the lapack library in /usr/lib. Below is my make file. Can you please let me... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

2. AIX

Add shared members from library to same library in a different directory

I'm trying to install libiconv to AIX 7.1 from an rpm off of the perzl site. The rpm appears to install but I get this error message. add shr4.o shared members from /usr/lib/libiconv.a to /opt/freeware/lib/libiconv.a add shr.o shared members from /usr/lib/libiconv.a to ... (5 Replies)
Discussion started by: kneemoe
5 Replies

3. Linux

./configure problem for libsf library due to apparently missing libdb library.

Hello, ./configure script fails to configure libsf. Please check the following last few lines of configure script error. checking for db1/db.h... no checking for db.h... yes checking for dbopen in -ldb1... no configure: error: No libdb? No libsf. But find command shows the following; ... (4 Replies)
Discussion started by: vectrum
4 Replies

4. Linux

Could static library include static library?

I have some static library(libxxx.a libyyy.a). And I want to generate my library(libzzz.a), libzzz.a will use libxxx.a and libyyy.a I wan't my application only use libzzz.a, (means libzzz.a had include libxxx.a, libyyy.a), how can I do that? Thank you. example: I have zzz.c. I do ... (4 Replies)
Discussion started by: freemagic
4 Replies

5. Shell Programming and Scripting

How to change a Makefile from building static library to shared library?

Hi: I have a library that it only offers Makefile for building static library. It built libxxx.a file. How do I in any way build a shared library? (either changin the Makefile or direct script or command to build shared library) Thanks. (1 Reply)
Discussion started by: cpthk
1 Replies

6. UNIX for Dummies Questions & Answers

GD library?

I've just been told that I need to install the GD library for PHP on my server, but I've got no idea how to do that or even:eek: where I can find it so that I can download and install it. Is it easy to do and how would I go about doing it?:confused: By the way I believe the server is running... (4 Replies)
Discussion started by: thehaapyappy
4 Replies

7. Programming

C library

Does anybody know are there free C library that implements most features of C++ standard library? e.g. I've used Berkeley in-memory db as maps (hash) but this isn't sufficient (7 Replies)
Discussion started by: Hitori
7 Replies
Login or Register to Ask a Question