LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2006, 06:41 PM   #1
fibbi
Member
 
Registered: Sep 2003
Distribution: gentoo
Posts: 101

Rep: Reputation: 16
autotools/gcc linker issue


hello,

I've just finished writing a decently-sized library in c++ to interface with amazon's s3 service. I'm trying to get it all packaged up now using autotools (automake, autoconf, and libtool).

I had to end up depending on a few libraries like libgcrypt. I've got everything working, except that, when I compile my tester program, I'm forced to link against all of the libraries used by my own libs3.

As an example:
libs3 depends on libgcrypt, and is thus compiled with -lgcrypt
To my knowledge, that _should_ be the end of it. However, when I try to compile s3Tester.cpp, the linker complains unless I pass a -lgcrypt there as well.

I'm assuming I've got some configuration problem in autotools, but I have no idea what. Any suggestions?

Thanks!
 
Old 05-08-2006, 07:10 PM   #2
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,381

Rep: Reputation: 47
how are you compiling your code? post some more info
 
Old 05-08-2006, 10:38 PM   #3
fibbi
Member
 
Registered: Sep 2003
Distribution: gentoo
Posts: 101

Original Poster
Rep: Reputation: 16
My configure.ac is the following:

----
AC_INIT(libs3, 0.1, Bobby Holley <bobbyholley@stanford.edu>)
AM_INIT_AUTOMAKE
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
-----

The Makefile.am in the top directory is the following:

----
EXTRA_DIST = reconf Doxyfile
SUBDIRS = src
----

The Makefile.am in the src directory is the following:

----
INCLUDES = -I${QTDIR}/include -I/usr/kde/3.5/include
AM_LDFLAGS = -L$(QTDIR)/lib
LDADD = -lqt-mt -lgcrypt -lkdecore
lib_LTLIBRARIES = libs3.la
TESTS = $(check_PROGRAMS)
include_HEADERS = s3.h
libs3_la_SOURCES = s3Internals.h AWSAuthConnection.cpp AWSAuthConnection.h base64.cpp base64.h HttpHandler.cpp HttpHandler.h HttpReadHandler.cpp HttpReadHandler.h HttpWriteHandler.h ListAllMyBucketsResponse.cpp ListAllMyBucketsResponse.h ListBucketResponse.cpp ListBucketResponse.h moc_HttpHandler.cpp moc_HttpReadHandler.cpp moc_HttpWriteHandler.cpp Response.cpp Response.h Utils.cpp Utils.h
----

I build the program like this:
$autoreconf
$./configure
$make

I'm sure there's some autoconf macro or something to do what I want, but I can't figure it out. Isn't that how libraries normally work? It doesn't seem like you should have to link against every dependency of your library when linking against it.

Thanks,
//BHolley
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"gcc linker" does not link C++ programs ( gxx_personality undefined ?) bahramH Programming 9 12-25-2009 01:38 PM
gcc Linker error - please help! Liche Programming 5 09-26-2005 07:14 AM
the linker is not working (gcc ) abd_bela Ubuntu 1 09-13-2005 03:51 PM
gcc linker question alenD Programming 2 08-01-2005 09:31 PM
gcc 3.4.2 and template issue ahwkong Programming 1 04-16-2005 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration