[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Undefined reference problem on 1.0.9
From: |
David Sugar |
Subject: |
Re: Undefined reference problem on 1.0.9 |
Date: |
Fri, 2 May 2003 08:45:49 -0400 |
User-agent: |
KMail/1.5 |
"Unix" local socket support is actually in -lccext2, not ccgnu2. Hence, you
need to extend your link statement a bit, using the result of
"ccgnu2-config --stdlibs"
On Friday 02 May 2003 06:28 am, Jakub Zawierucha wrote:
> Hi there... this is my first battle with CommonC++ (and automake so...
> don't angry :) )
>
> When i try to use CommonC++ in my program i get error at linking stage:
>
> address@hidden:/vol/home/t3q/src/koszty$ make
> Making all in src
> make[1]: Entering directory `/vol/home/t3q/src/koszty/src'
> c++ -g -O2 -o koszty Main.o -lstdc++ -lccgnu2 -lpthread -ldl
> Main.o: In function `basic_string<char, string_char_traits<char>,
> __default_alloc_template<true, 0> >::replace(unsigned int, unsigned int,
> char const *, unsigned int)':
> /usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/std/bastring.c
>c:156:
>
> undefined reference to `ost::UnixSocket::UnixSocket(char const *, int)'
> collect2: ld returned 1 exit status
> make[1]: *** [koszty] Error 1
> make[1]: Leaving directory `/vol/home/t3q/src/koszty/src'
> make: *** [all-recursive] Error 1
> address@hidden:/vol/home/t3q/src/koszty$
>
> This is my makefile.am:
>
> address@hidden:/vol/home/t3q/src/koszty/src$ cat Makefile.am
> MAINTAINERCLEANFILES = Makefile.in Makefile
>
> CXXFLAGS = @CXXFLAGS@ $(THREAD_FLAGS)
> LDADD = -lstdc++ -lccgnu2 -lpthread -ldl
>
> noinst_PROGRAMS = koszty
> #koszty_HEADERS =
> koszty_SOURCES = Main.cc
> koszty_LDADD = $(LDADD)
>
> And this is code:
> address@hidden:/vol/home/t3q/src/koszty/src$ cat Main.cc
>
> #include <cc++/unix.h>
>
> using namespace ost;
> using namespace std;
>
> int main ( int argc, char *argv )
> {
> UnixSocket *usock;
>
> usock = new UnixSocket ("my.sock");
>
> delete usock;
>
> return 0;
> }
>
> Thanx for any help !
>
> Jakub Zawierucha
>
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp