I have a shared library(in c++) that has a function foo() (declared as extern c) which is called by a function in a project in C that is compiled by automake. so I hv a makefile.am which directs to an include.am where I have added the name and location of my library /../Release/lib/libabc.so to the xyz_LDADD variable, precisely i have xyz_LDADD=libabc.so
the declaration of foo looks like this :
#ifdef __cplusplus
extern "C" {
#endif
void foo(void);
#ifdef __cplusplus
}
#endif
when i try to make, i get an undefined reference to foo() error.
If I change the name of d library abc, i get an error, so I assume the compiler is able to find the library.
I have also some static libraries that are working fine. Can anybody help please.. Thanks in advance
xyz_LDADD = -L/../Release/lib/ -labc
? (normally you don't put the full name of the library, just the part after the "lib" and before the ".so". – Galik