Discussion:
AC_CHECK_LIB for C++ libraries
Jan Mikelson
2012-11-02 11:04:51 UTC
Permalink
Hey everyone,

I am currently writing configure.ac and Makefile.am files for a project
I have been working on. The project consists of some C++ shared
libraries and one executable. If they were C libraries I could just use

AC_CHECK_LIB([lib1], [function1])

to check whether the library lib1 is available. This does not work with
C++ libraries. Is there a similar way of doing this for C++ libraries? I
could not find anything helpful online and would appreciate any help!
Thanks a lot!

Cheers

Jan
Peter Johansson
2012-11-02 14:14:31 UTC
Permalink
Post by Jan Mikelson
Hey everyone,
I am currently writing configure.ac and Makefile.am files for a project
I have been working on. The project consists of some C++ shared
libraries and one executable. If they were C libraries I could just use
AC_CHECK_LIB([lib1], [function1])
to check whether the library lib1 is available. This does not work with
C++ libraries. Is there a similar way of doing this for C++ libraries? I
could not find anything helpful online and would appreciate any help!
Thanks a lot!
I've used AC_LINK_IFELSE to check for C++ libs.

Cheers,
Peter
Jan Mikelson
2012-11-02 14:45:05 UTC
Permalink
Post by Peter Johansson
Post by Jan Mikelson
Hey everyone,
I am currently writing configure.ac and Makefile.am files for a project
I have been working on. The project consists of some C++ shared
libraries and one executable. If they were C libraries I could just use
AC_CHECK_LIB([lib1], [function1])
to check whether the library lib1 is available. This does not work with
C++ libraries. Is there a similar way of doing this for C++ libraries? I
could not find anything helpful online and would appreciate any help!
Thanks a lot!
I've used AC_LINK_IFELSE to check for C++ libs.
Cheers,
Peter
Hey Peter,
thanks for your reply, but how exactly do you do this? If you don't have
time to explain it, I would very much appreciate it, if you could point
me to a documentation, where I could read it up. Thank you very much!

Cheers

Jan
Peter Johansson
2012-11-04 01:28:32 UTC
Permalink
Post by Jan Mikelson
Hey Peter,
thanks for your reply, but how exactly do you do this? If you don't have
time to explain it, I would very much appreciate it, if you could point
me to a documentation, where I could read it up. Thank you very much!
Check the autoconf manual ;)

http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-the-Linker

If you need an example the macro '_YAT_CHECK_LIB_YAT' might be useful

http://dev.thep.lu.se/yat/svn/trunk/m4/yat.m4

Cheers,
Peter

Loading...