Opened 11 years ago

Closed 11 years ago

#6328 closed Bugs (worksforme)

Mac OSX linker boost::system category referenced from static..

Reported by: noah.whiteis@… Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

When I compile Boost.asio or boost.filesystem code (GCC4.3) in mac osx I get

Build boosttesttwo of project boosttesttwo with configuration Debug

Ld ./boosttesttwo.app/Contents/MacOS/boosttesttwo normal i386 cd /Users/noahwhiteis/C++/nm/boosttesttwo setenv MACOSX_DEPLOYMENT_TARGET 10.6 /Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L. -L/opt/local/lib -Lcs106 -L/Users/noahwhiteis/C++/nm/boosttesttwo/cs106 -L/opt/local/lib -F. -filelist /Users/noahwhiteis/C++/nm/boosttesttwo/build/boosttesttwo.build/Debug/boosttesttwo.build/Objects-normal/i386/boosttesttwo.LinkFileList -mmacosx-version-min=10.6 -framework Cocoa -framework Carbon -lcs106 -o ./boosttesttwo.app/Contents/MacOS/boosttesttwo

Undefined symbols:

"boost::filesystem3::detail::file_size(boost::filesystem3::path const&, boost::system::error_code*)", referenced from:

boost::filesystem3::file_size(boost::filesystem3::path const&)in main.o

"boost::system::system_category()", referenced from:

static_initialization_and_destruction_0(int, int)in main.o

"boost::filesystem3::path::wchar_t_codecvt_facet()", referenced from:

boost::filesystem3::path::codecvt() in main.o

"boost::system::generic_category()", referenced from:

static_initialization_and_destruction_0(int, int)in main.o static_initialization_and_destruction_0(int, int)in main.o

ld: symbol(s) not found collect2: ld returned 1 exit status

Change History (4)

comment:1 by Marshall Clow, 11 years ago

Boost.System and Boost.FileSystem are not header-only libraries. You need to create the libraries and link to them.

By the way, it appears that you created four identical tickets - was that on purpose?

comment:2 by anonymous, 11 years ago

I do have the libraries for each library including filesystem and system in dylib

comment:3 by Marshall Clow, 11 years ago

But in the build commands that you posted, I see no evidence that you are linking to them.

-l libSystem (say)

comment:4 by René Rivera, 11 years ago

Resolution: worksforme
Severity: ShowstopperProblem
Status: newclosed
Note: See TracTickets for help on using tickets.