undefined reference to "..."

Discussion in 'C Programming' started by zqiang320, Sep 27, 2008.

  1. zqiang320

    zqiang320 Guest

    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
    zqiang320, Sep 27, 2008
    #1
    1. Advertising

  2. zqiang320

    Ian Collins Guest

    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.
    Ian Collins, Sep 27, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Felipe
    Replies:
    3
    Views:
    432
    Felipe
    Jul 16, 2004
  2. Lu
    Replies:
    1
    Views:
    544
    Roel Schroeven
    Jul 10, 2003
  3. Mantorok Redgormor
    Replies:
    70
    Views:
    1,712
    Dan Pop
    Feb 17, 2004
  4. VK
    Replies:
    45
    Views:
    564
    Dr John Stockton
    Sep 12, 2006
  5. -Lost
    Replies:
    13
    Views:
    350
    Richard Cornford
    Jan 31, 2007
Loading...

Share This Page