I'm not sure if I'm completely missing the point here, but I can't find a place to add linker options in the Eclipse CDT plugin for an Autotools project.
I want to link a static library with a -l option
I was expecting to find them in a tab with a name like 'linker' after going to
Project -> Properties -> C/C++ Build -> Settings
Where do I get to the linker options?
If I can't do it like this then which config or make file can I edit manually to achieve the same result (linking a static library)
--edit--
I came across a recommendation that I should add this to my configure.ac
PKG_CHECK_MODULES([DEPS], [libavutil >= 6:0.8.10-1 libavformat >= 6:0.8.10-1 libavcodec >= 6:0.8.10-1])
I tried this but this doesn't persuade autotools to tell the linker to link the appropriate libraries. Have I missed something???
--edit 2--
My Makefile.am was the default as generated by the CDT new project wizard for an autotools project.
SUBDIRS=src
The Config.ac file was as per default too...
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(HelloWorld, 1.0)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE()
AC_PROG_CXX
AC_CONFIG_FILES(Makefile src/Makefile)
AC_OUTPUT
I tried adding in a line to the Config.ac that looked like this:
PKG_CHECK_MODULES([libav], [libavutil >= 6:0.8.10-1 libavformat >= 6:0.8.10-1 libavcodec >= 6:0.8.10-1])
I put this line just after the 'AC_PROG_CXX' line
I then added the following to my Makefile.am...
HelloWorld_CPPFLAGS = $(libav_CFLAGS)
HelloWorld_LDFLAGS= $(libav_LIBS)
The file HelloWorld.cpp is just a quick test that should report the libavformat version
#include <stdio.h>
extern "C" {
#include <libavformat/avformat.h>
}
int main(void) {
int avVer = avformat_version();
printf("libavformat version number: %d", avVer);
return 0;
}
This is all managed by the eclipse CDT.