what is "Undefined first referenced symbol in file"

Discussion in 'C++' started by Will hunting, Jan 4, 2007.

  1. Will hunting

    Will hunting Guest

    hi, when compiling using makefile on unix, I encounter such problem,
    anyone has similar experience on this?
    what could be the possible cause? thanks


    make OBJS=out/release "EXTRAFLAGS=-O -DNDEBUG" world

    /u04/app/forte/SUNWspro/bin/CC -c -O -DNDEBUG -pto -PIC -DIL_STD
    -DILDORACLE -I/usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -I/u04/app/ilog/dblink50/include
    src/IDODBInterface.cpp -o out/release/IDODBInterface.o

    usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -Iusr/include
    -I/u04/app/ilog/cplex71/include -I/u04/app/ilog/concert11/include
    -I/u04/app/ilog/dblink50/include src/IDODataA.cpp -o
    out/release/IDODataA.o

    /u04/app/forte/SUNWspro/bin/CC -c -O -DNDEBUG -pto -PIC -DIL_STD
    -DILDORACLE -I/usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -I/u04/app/ilog/dblink50/include
    src/IDOEngineImplA.cpp -o out/release/IDOEngineImplA.o

    /u04/app/forte/SUNWspro/bin/CC -c -O -DNDEBUG -pto -PIC -DIL_STD
    -DILDORACLE -I/usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -I/u04/app/ilog/dblink50/include
    src/IDOTextInterface.cpp -o out/release/IDOTextInterface.o

    /u04/app/forte/SUNWspro/bin/CC -c -O -DNDEBUG -pto -PIC -DIL_STD
    -DILDORACLE -I/usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -I/u04/app/ilog/dblink50/include
    src/helpers.cpp -o out/release/helpers.o

    /u04/app/forte/SUNWspro/bin/CC -c -O -DNDEBUG -pto -PIC -DIL_STD
    -DILDORACLE -I/usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -I/u04/app/ilog/dblink50/include
    src/ildutil.cpp -o out/release/ildutil.o

    /u04/app/forte/SUNWspro/bin/CC -c -O -DNDEBUG -pto -PIC -DIL_STD
    -DILDORACLE -I/usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -I/u04/app/ilog/dblink50/include
    src/main.cpp -o out/release/main.o

    /u04/app/forte/SUNWspro/bin/CC -O -DNDEBUG -pto -PIC -DIL_STD
    -DILDORACLE -I/usr/include -I/u04/app/ilog/cplex71/include
    -I/u04/app/ilog/concert11/include -I/u04/app/ilog/dblink50/include
    out/release/IDODBInterface.o out/release/IDODataA.o out/release/ID


    OEngineImplA.o out/release/IDOTextInterface.o out/release/helpers.o
    out/release/ildutil.o out/release/main.o -L/export/home/liguan/lib
    -lcommon -L/u04/app/ilog/cplex71/lib/sparc_5_5.0/static_pic_mt
    -lilocplex -lcplex -L/u04/app/ilog/concert11/lib/sparc_5_


    5.0/static_pic_mt -lconcert -L/u01/app/oracle/product/8.1.7/lib
    -lclntsh -L/u04/app/ilog/dblink50/lib/sparc_5_5.0/static_pic_mt
    -ldbora81 -ldbkernel -ldblnkst -lilog -lsocket -lnsl -lthread -ldl -o
    out/engine

    Undefined first referenced

    symbol in file

    std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >FpcIntegration::solveFPC(double) out/release/IDODataA.o


    FpcIntegration::FpcIntegration() out/release/IDODataA.o

    ld: fatal: Symbol referencing errors. No output written to out/engine

    *** Error code 1

    make: Fatal error: Command failed for target `out/engine'

    Current working directory /export/home/liguan/IDO

    *** Error code 1

    make: Fatal error: Command failed for target `release'

    $
    Will hunting, Jan 4, 2007
    #1
    1. Advertising

  2. Will hunting

    Jim Langston Guest

    "Will hunting" <> wrote in message
    news:...
    > hi, when compiling using makefile on unix, I encounter such problem,
    > anyone has similar experience on this?
    > what could be the possible cause? thanks


    <SNIP>

    > Undefined first referenced
    >
    > symbol in file
    >
    > std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>
    >> > > >FpcIntegration::solveFPC(double) out/release/IDODataA.o

    >
    > FpcIntegration::FpcIntegration() out/release/IDODataA.o
    >
    > ld: fatal: Symbol referencing errors. No output written to out/engine
    >
    > *** Error code 1
    >
    > make: Fatal error: Command failed for target `out/engine'
    >
    > Current working directory /export/home/liguan/IDO
    >
    > *** Error code 1
    >
    > make: Fatal error: Command failed for target `release'


    Sounds like you forgot to:
    #include <string>
    #include <vector>

    Or, the method:
    solveFPC in the class FpcIntegration is not defined.
    Jim Langston, Jan 4, 2007
    #2
    1. Advertising

  3. Will hunting

    Will hunting Guest

    thanks, I have found that in my makefile, I forgot to add -lfpc to
    include the libfpc.so shared objects, so that when linking, error msg
    symbol not defined appeared.
    Will hunting, Jan 4, 2007
    #3
    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.

Share This Page