[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: please help: cannot link c-library into kde-program
From:       Lubos Lunak <l.lunak () sh ! cvut ! cz>
Date:       1999-12-19 22:03:14
[Download RAW message or body]

On Ne, 19 pro 1999, claus wilke wrote :
>Hi,
>
>this is probably a stupid question, but since I cannot resolve it with the gcc
>man pages, I am asking this on this list. There are certainly people here who
>know the answer.
>
>I have a c-library that I want to link into a kde-program. However, gcc doesn't
>recognize the symbols in the library. Any -l<libname> and -L<path to the
>library> doesn't help. Even giving the library directly as an input file name
>in addition to the object files does not help. So I assume that c-libraries are
>somewhat different from c++ libraries and cannot simply be linked together. How
>can I resolve this?

It should work the way you describe it, maybe just the C library headers miss
extern "C" around the declarations. Try this :
extern "C"
{
#include <header_of_the_c_lib_you_need.h>
}

>
>Another question: can I configure autoconf/automake such that it automatically
>configures and makes the library which resides in a subdir?
>( Say, my program is dir ./, and the library is in ./clib. The commands
>'./configure' and 'make' in dir ./clib configure and make the library. It would
>be neat if they could be called automatically when the user types ./configure
>and make in directory ./).  

See AC_CONFIG_SUBDIRS ( info autoconf ).

>
>Many thanks for any answers,
>Best,
>  Claus

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic