On 20 August 2013 23:52, Marshall Clow <mclow.lists@gmail.com> wrote:

On Aug 20, 2013, at 1:30 PM, Bioxydyn Dev <bioxydyn.dev@gmail.com> wrote:

On Tue, Aug 20, 2013 at 8:05 PM, Marshall Clow <mclow.lists@gmail.com> wrote:

On Aug 20, 2013, at 10:28 AM, Bioxydyn Dev <bioxydyn.dev@gmail.com> wrote:

But I suspect that you _are_ using Apple's linker (ld), and it does not understand -h.

Why do you suspect that Apple's linker is being invoked?

Because it doesn't understand -h?

And why would it not invoke GCC's linker when I've specified the toolset=gcc?

because they're both (helpfully) named "ld" ?
and because if you just download and build gcc, I believe that you don't get a standalone linker.
[ At least I didn't when building gcc 4.7.2 and 4.8 ]

Please elaborate. Why would it not come with a linker? That doesn't make any sense?

I didn't say that.
I said it didn't come with a *standalone* linker.

if you do:
g++ junk.cpp -o junk
it will compile and link.  (g++ knows how to link)

If you do:
g++ -c junk,cpp -o junk.o
ld junk.o -o junk
the first command will produce an object file (junk.o)
and the second will produce an executable (using ld).

b2 issues separate compile and link commands (like the second example)

How can I check which one it's using.

ld -v is a good place to start.

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-136
configured to support archs: armv6 armv7 armv7s i386 x86_64
LTO support using: LLVM version 3.2svn, from Apple Clang 4.2 (build 425.0.28)

You can also look at the output from running b2 - it should print the commands that it uses.
b2 -n will print the commands w/o executing them.

I also stumbled across your C++ musings and Xcode stuff. Very helpful.

Thanks.

From what I've managed to ascertain it looks like if I want to develop for OS X then I should install the latest version of Xcode. Would you agree?

Yes. Note that there's a "command-line tools" package inside of Xcode that you'll want to install (look in preferences).
It's much easier than fussing with gcc - even if you are using MacPorts, etc.

-- Marshall

Just to let you know, Marshall, I followed your advice and got it working using clang. Thanks for your help.

I had some trouble with dynamic libs when running the example code but I fixed that by using install_name_tool to change the install name of the boost library.

cheers

Joe.