Re: Problems using Boost, Pls Advise

From: llewelly (llewelly.at_at_xmission.dot.com)
Date: 04/28/04


Date: 28 Apr 2004 05:34:02 -0400

sbobrows <sbobrows@animatedlearning.com> writes:

> {Whilst I think much of this is OT for this newsgroup, I think the issue
> of understanding diagnostics just about gets under the door. -mod}
>
> Hi,
>
> I'm a C++ newbie trying to use the Boost regex libraries. Here's my
> situation.
>
> My system is Red Hat Linux 9, using the Borland C++BuilderX Personal IDE
> (which uses the g++ compiler).
>
> I downloaded and installed Boost from boost.org using the command:
>
> bjam -sTOOLS=gcc install
>
> The install seemed to complete fine, with 2900+ targets updated.
>
> The libraries install in /usr/local/include/boost-1_31/boost.
>
> I created the following link:
>
> ln -s /usr/local/include/boost-1_31/boost /usr/include/boost
>
> I then use C++BuilderX to try and compile one of the example programs
> for the regex libaries that I found in the documentation. The source
> code is:
>
{quoted code snipped by mod. -mod/fwg}
[snip]

I don't know how to answer this without making the answer g++
     specific. So those of you without g++, please bear with me.

Most libraries consist of two parts: header files, and binary
     libraries containing compiled code. On most unicies, any error
     about 'undefined reference to ...' or 'undefined symbol ...'
     means the compiled binary libs were not found, or are
     inconsistent with the header files.

You need to tell your compiler how to link in the binary library
     containing the compiled code for boost::regex.

This will be different for each implementation, but for GCC, you must
     tell the compiler two things:

     (0) The name of the binary library, using '-l<library name>',
     (1) The location of the library, using
         '-L<directory containing compiled library>'

So your link command line should look something like this:

g++ linux/Debug_Build/splittest.o -lboost_regex -L/usr/local/lib

Finally see the gcc documentation: http://xrl.us/bx2p .

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated. First time posters: Do this! ]



Relevant Pages

  • Re: How do you make this Open Source work on Solaris ?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.programmer)
  • Re: How do you make this Open Source work on Solaris 10?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.shell)
  • Re: Corrupted C Compiler
    ... libraries). ... extensions) and said I needed to recompile them with this command: ... doesn't have anything at all to do with the system C compiler. ... patches and some additional magic is performed after the build that ...
    (freebsd-questions)
  • Re: How do you make this Open Source work on Solaris ?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.programmer)
  • Re: Borland C++BuilderX
    ... Mostly, programmers do not worry about the contents of header files, ... the rest of the source code that I provide but use the full name when I ... The next two lines of our program are instructions to the compiler to ... object code files and libraries. ...
    (alt.comp.lang.learn.c-cpp)

Loading