Statically Linking Libraries

Discussion in 'C++' started by LinuxN00b, Aug 6, 2003.

  1. LinuxN00b

    LinuxN00b Guest

    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_Directory

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

    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_Directory
    /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
     
    LinuxN00b, Aug 6, 2003
    #1
    1. Advertising

  2. LinuxN00b wrote:
    > Hey,
    >
    > I have a problem linking Xerces-c (Apache's XMLParser)
    > with my program.

    [...]

    > How do I link with this library?
    >
    > Thanks in advance.
    >
    > Peace.
    >
    > Ben Chan


    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:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
     
    Thomas Matthews, Aug 6, 2003
    #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. Martin Pein

    Linking native libraries in Win2K

    Martin Pein, Oct 9, 2003, in forum: Java
    Replies:
    4
    Views:
    2,072
    Martin Pein
    Oct 14, 2003
  2. Replies:
    2
    Views:
    417
    Tom St Denis
    May 30, 2004
  3. T

    Linking statically

    T, Jan 10, 2006, in forum: C Programming
    Replies:
    5
    Views:
    385
    Grumble
    Jan 13, 2006
  4. Phil Tomson
    Replies:
    0
    Views:
    120
    Phil Tomson
    May 10, 2004
  5. Indigo Casson

    "Statically linking" native extensions.

    Indigo Casson, May 26, 2010, in forum: Ruby
    Replies:
    0
    Views:
    89
    Indigo Casson
    May 26, 2010
Loading...

Share This Page