Statically Linking Libraries

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • LinuxN00b

    #1

    Statically Linking Libraries

    Hey,

    I have a problem linking Xerces-c (Apache's XMLParser)
    with my program.

    Here is a copy of my makefile.

    # CXX is for GNU make, CCC is for Solaris make # Define the default
    compiler to use for C++ programs as u++
    CXX=g++
    #CXXFLAGS=-g
    CCC=g++ # Define the default compiler to use for C++ programs as g++

    all: Deflate_Directo ry

    Deflate_Directo ry: XMLParser.o FileGen.o Main.o
    $(CXX) XMLParser.o -lxerces-c_2 FileGen.o Main.o -o Deflate_Directo ry

    XMLParser.o: XMLParser.h XMLParser.cpp
    FileGen.o: XMLParser.h FileGen.h FileGen.cpp
    Main.o: XMLParser.h FileGen.h Main.cpp

    clean:
    rm *.o


    Here is the result from running make.

    g++ XMLParser.o -lxerces-c_2 FileGen.o Main.o -o Deflate_Directo ry
    /usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../../i686-pc-cygwin/bin/ld:
    cannot fi
    nd -lxerces-c_2
    collect2: ld returned 1 exit status

    I tried listing the actual directory it is located and tried copying
    the lib file and the dll file into my local directory. It still
    cannot link with this library.

    How do I link with this library?

    Thanks in advance.

    Peace.

    Ben Chan
  • Thomas Matthews

    #2
    Re: Statically Linking Libraries

    LinuxN00b wrote:[color=blue]
    > Hey,
    >
    > I have a problem linking Xerces-c (Apache's XMLParser)
    > with my program.[/color]
    [...]
    [color=blue]
    > How do I link with this library?
    >
    > Thanks in advance.
    >
    > Peace.
    >
    > Ben Chan[/color]

    Linking is an implementation issue and best discussed
    in a newsgroup about your compiler or operating system.
    The C++ has no facilities or requirements for linking.
    Your post is off-topic for this newsgroup.

    --
    Thomas Matthews

    C++ newsgroup welcome message:

    C++ Faq: http://www.parashift.com/c++-faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.l earn.c-c++ faq:

    Other sites:
    http://www.josuttis.com -- C++ STL Library book

    Comment

    Working...