Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > undefined reference to "..."

Reply
Thread Tools

undefined reference to "..."

 
 
zqiang320
Guest
Posts: n/a
 
      09-27-2008
Hello:

I execute make ,then get error:

$ make
Making all in libsbml/src
make[1]: Entering directory `/home/internet/mydoc/test_pj/libsbml/src'
........
/bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -o test test.o
libsbml/src/libsbml.la -lsbml -lstdc++ -lm
mkdir .libs
gcc -g -O2 -o .libs/test test.o libsbml/src/.libs/libsbml.so -lstdc++
-lm -Wl,--rpath -Wl,/usr/local/lib
libsbml/src/.libs/libsbml.so: undefined reference to `safe_strdup'
libsbml/src/.libs/libsbml.so: undefined reference to
`util_bsearchStringsI'
libsbml/src/.libs/libsbml.so: undefined reference to `safe_malloc'
libsbml/src/.libs/libsbml.so: undefined reference to `util_PosInf'
libsbml/src/.libs/libsbml.so: undefined reference to `util_isInf'
libsbml/src/.libs/libsbml.so: undefined reference to `util_NaN'
libsbml/src/.libs/libsbml.so: undefined reference to `safe_calloc'
libsbml/src/.libs/libsbml.so: undefined reference to
`strcmp_insensitive'
libsbml/src/.libs/libsbml.so: undefined reference to `c_locale_strtod'

Why system can not find these function ,they are system file
<stdlib.h> <new> <cmath>
which has been included in my app.c.
What should I do?
Eager to receive your reply!

my configure.in file:

AC_INIT(main, 0.1, )
AM_INIT_AUTOMAKE(foreign)
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LIBTOOL
AC_OUTPUT(Makefile libsbml/src/Makefile)

my Makefile.am file:

bin_PROGRAMS = test
SUBDIRS = libsbml/src .
test_SOURCES = test.c

test_LDADD = libsbml/src/libsbml.la -lsbml -lstdc++ -lm

AM_CPPFLAGS = -Ilibsbml/include

my libsbml/src/Makefile.am

AUTOMAKE_OPTS = gnu
lib_LTLIBRARIES = libsbml.la
libsbml_la_SOURCES = common/libsbml-version.cpp math/ASTNode.cpp math/
FormulaTokenizer.c util/List.cpp
AM_CPPFLAGS = -I../include -lsbml -lstdc++ -lm
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      09-27-2008
zqiang320 wrote:
> Hello:
>
> I execute make ,then get error:
>
> $ make
> Making all in libsbml/src
> make[1]: Entering directory `/home/internet/mydoc/test_pj/libsbml/src'
> ........
> /bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -o test test.o
> libsbml/src/libsbml.la -lsbml -lstdc++ -lm
> mkdir .libs


>
> Why system can not find these function ,they are system file
> <stdlib.h> <new> <cmath>
> which has been included in my app.c.


You are building something as C++ and this is a C group. If you should
be building as C, fix things so you do, if you are building C++ code,
try a platform or gnu list where you will get better help. Tool
problems are as off topic on c.l.c++ as they are here.

--
Ian Collins.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
typeof x == 'undefined' or x == undefined? -Lost Javascript 13 01-31-2007 12:04 AM
undefined vs. undefined (was: new Array() vs []) VK Javascript 45 09-12-2006 05:26 PM
'Undefined' Client-Side Object Reference Felipe ASP .Net 3 07-16-2004 04:01 AM
undefined behavior or not undefined behavior? That is the question Mantorok Redgormor C Programming 70 02-17-2004 02:46 PM
Error: 'undefined reference' in g++ but gcc succeeded Lu C++ 1 07-10-2003 12:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57