undefined reference to "..."

Z

zqiang320

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, (e-mail address removed))
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
 
I

Ian Collins

zqiang320 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top