Configure fails under FreeBSD 8.2 amd64

Greetings. I’m trying to build the VCMI from svn, but configure script hangs at the point where it’s looking for SDL library

checking for sdl-config... yes
checking for SDL_Init in -lSDL... no
configure: error: SDL library not found. Please install it
$ pkg_info -xI sdl
sdl-1.2.14_2,2      Cross-platform multimedia development API
sdl_image-1.2.10_2  A simple library to load images of various formats as SDL s
sdl_mixer-1.2.11_2  A sample multi-channel audio mixer library
sdl_net-1.2.7       A small sample cross-platform networking library
sdl_sound-1.0.3_4   A SDL audio library and player for some popular sound file 
sdl_ttf-2.0.10      A library to use TrueType fonts to render text in SDL appli
$ ldconfig -r | grep -i sdl
        176:-laggplatformsdl.2 => /usr/local/lib/libaggplatformsdl.so.2
        274:-lSDL_image-1.2.8 => /usr/local/lib/libSDL_image-1.2.so.8
        482:-lSDL_mixer-1.2.10 => /usr/local/lib/libSDL_mixer-1.2.so.10
        541:-lSDL_ttf-2.0.10 => /usr/local/lib/libSDL_ttf-2.0.so.10
        619:-lSDL_sound.1 => /usr/local/lib/libSDL_sound.so.1
        623:-lSDL_net-1.2.0 => /usr/local/lib/libSDL_net-1.2.so.0
        659:-lSDL-1.2.11 => /usr/local/lib/libSDL-1.2.so.11

Is there anything missing on my system? Any help appreciated

$ uname -srm
FreeBSD 8.2-RELEASE amd64

You probably need the header files; for instance /usr/include/SDL/SDL.h.

Hello ubuntux, thanks for response.
There is SDL headers installed in /usr/local/include/SDL on my system:

$ pkg_info -W /usr/local/include/SDL/SDL.h
/usr/local/include/SDL/SDL.h was installed by package sdl-1.2.14_2,2

I don’t think it’s headers issue, usually missing headers gives another output.

$ env LC_ALL=en_GB.UTF-8 ls -l /usr/local/include/SDL/
total 673
-rw-r--r--  1 root  wheel    3233  1 Jun 14:25 SDL.h
-rw-r--r--  1 root  wheel    1933  1 Jun 14:25 SDL_active.h
-rw-r--r--  1 root  wheel   11215  1 Jun 14:25 SDL_audio.h
-rw-r--r--  1 root  wheel     986  1 Jun 14:25 SDL_byteorder.h
-rw-r--r--  1 root  wheel    6048  1 Jun 14:25 SDL_cdrom.h
-rw-r--r--  1 root  wheel    9084  1 Jun 14:25 SDL_config.h
-rw-r--r--  1 root  wheel    2221  1 Jun 14:25 SDL_cpuinfo.h
-rw-r--r--  1 root  wheel    5873  1 Jun 14:25 SDL_endian.h
-rw-r--r--  1 root  wheel    1874  1 Jun 14:25 SDL_error.h
-rw-r--r--  1 root  wheel   13041  1 Jun 14:25 SDL_events.h
-rw-r--r--  1 root  wheel     979  1 Jun 14:25 SDL_getenv.h
-r--r--r--  1 root  wheel    5277 17 Aug  2010 SDL_image.h
-rw-r--r--  1 root  wheel    5532  1 Jun 14:25 SDL_joystick.h
-rw-r--r--  1 root  wheel    4098  1 Jun 14:25 SDL_keyboard.h
-rw-r--r--  1 root  wheel    7492  1 Jun 14:25 SDL_keysym.h
-rw-r--r--  1 root  wheel    2739  1 Jun 14:25 SDL_loadso.h
-rw-r--r--  1 root  wheel    2866  1 Jun 14:25 SDL_main.h
-rw-r--r--  1 root  wheel   27183 27 Mar 15:43 SDL_mixer.h
-rw-r--r--  1 root  wheel    4754  1 Jun 14:25 SDL_mouse.h
-rw-r--r--  1 root  wheel    5860  1 Jun 14:25 SDL_mutex.h
-rw-r--r--  1 root  wheel     183  1 Jun 14:25 SDL_name.h
-r--r--r--  1 root  wheel   17299 14 Dec  2009 SDL_net.h
-rw-r--r--  1 root  wheel  336292  1 Jun 14:25 SDL_opengl.h
-rw-r--r--  1 root  wheel    2708  1 Jun 14:25 SDL_platform.h
-rw-r--r--  1 root  wheel    2009  1 Jun 14:25 SDL_quit.h
-rw-r--r--  1 root  wheel    4958  1 Jun 14:25 SDL_rwops.h
-r--r--r--  1 root  wheel   25770  8 Sep  2010 SDL_sound.h
-rw-r--r--  1 root  wheel   16473  1 Jun 14:25 SDL_stdinc.h
-rw-r--r--  1 root  wheel    6266  1 Jun 14:25 SDL_syswm.h
-rw-r--r--  1 root  wheel    4494  1 Jun 14:25 SDL_thread.h
-rw-r--r--  1 root  wheel    4527  1 Jun 14:25 SDL_timer.h
-r--r--r--  1 root  wheel   10554 17 Aug  2010 SDL_ttf.h
-rw-r--r--  1 root  wheel     979  1 Jun 14:25 SDL_types.h
-rw-r--r--  1 root  wheel    2637  1 Jun 14:25 SDL_version.h
-rw-r--r--  1 root  wheel   38018  1 Jun 14:25 SDL_video.h
-rw-r--r--  1 root  wheel    5128  1 Jun 14:25 begin_code.h
-rw-r--r--  1 root  wheel    1482  1 Jun 14:25 close_code.h

There should be an error in config.log. If you don’t see it, post it so I can take a look.

Thank you for assistance. I’m not familiar with programming stuff, otherwise I would find solution myself. There is an error I’ve found in config.log:

configure:16035: checking for sdl-config
configure:16051: found /usr/local/bin/sdl-config
configure:16063: result: yes
configure:16075: checking for SDL_Init in -lSDL
configure:16100: g++ -o conftest -g -O2 -O0 -ggdb -Wall -Wno-switch -Wno-sign-compare -Wcast-align -Wpointer-arith -Wno-unknown-pragmas   conftest.cpp -lSDL  >&5
/usr/bin/ld: cannot find -lSDL
configure:16100: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "vcmi"
| #define PACKAGE_TARNAME "vcmi"
| #define PACKAGE_VERSION "0.84b"
| #define PACKAGE_STRING "vcmi 0.84b"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "vcmi"
| #define VERSION "0.84b"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define HAVE_BOOST /**/
| #define HAVE_BOOST_SYSTEM /**/
| #define HAVE_BOOST_FILESYSTEM /**/
| #define HAVE_BOOST_THREAD /**/
| #define HAVE_BOOST_IOSTREAMS /**/
| #define HAVE_BOOST_PROGRAM_OPTIONS /**/
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char SDL_Init ();
| int
| main ()
| {
| return SDL_Init ();
|   ;
|   return 0;
| }
configure:16109: result: no
configure:16119: error: SDL library not found. Please install it

I uploaded the whole config.log to pastebin: pastebin.com/aLZeaFPS

So libSDL is not found.

Check whether you have /usr/local/lib/libSDL.so

On my linux host, I have:

lrwxrwxrwx 1 root root     20 2010-10-10 11:51 /usr/lib/libSDL-1.2.so.0 -> libSDL-1.2.so.0.11.3
-rw-r--r-- 1 root root 422216 2010-07-02 02:50 /usr/lib/libSDL-1.2.so.0.11.3
-rw-r--r-- 1 root root 852168 2010-07-02 02:50 /usr/lib/libSDL.a
-rw-r--r-- 1 root root    921 2010-07-02 02:50 /usr/lib/libSDL.la
lrwxrwxrwx 1 root root     20 2010-10-10 11:51 /usr/lib/libSDL.so -> libSDL-1.2.so.0.11.3

If you do, then try to configure with

LDFLAGS=-L/usr/local/lib   ./configure

Thanks a lot! Today I’ve downloaded the lastest svn and tried your solution. This time configure was unable to find SDL headers even when I tried to execute it like this:

./configure --includedir=/usr/local/include

Finally, thanks for your message, I managed to offer the proper question to google :stuck_out_tongue: and it told me how to force configure to search headers in selected dir.

env LDFLAGS=-L/usr/local/lib CPPFLAGS="-I/usr/local/include ./configure

Configure was OK, but after 5-10 minutes of compilation it stopped with error:

GameHandler.cpp:4078: warning: comparison is always false due to limited range of data type
CGameHandler.cpp:4139: warning: comparison is always false due to limited range of data type
CGameHandler.cpp: In member function 'void CGameHandler::makeStackDoNothing(const CStack*)':
CGameHandler.cpp:4613: warning: taking address of temporary
CGameHandler.cpp:4614: warning: taking address of temporary
CGameHandler.cpp: In member function 'void CGameHandler::runBattle()':
CGameHandler.cpp:4818: warning: taking address of temporary
CGameHandler.cpp:4819: warning: taking address of temporary
/usr/local/include/boost/asio/error.hpp: At global scope:
/usr/local/include/boost/asio/error.hpp:251: warning: 'boost::asio::error::system_category' defined but not used
/usr/local/include/boost/asio/error.hpp:253: warning: 'boost::asio::error::netdb_category' defined but not used
/usr/local/include/boost/asio/error.hpp:255: warning: 'boost::asio::error::addrinfo_category' defined but not used
/usr/local/include/boost/asio/error.hpp:257: warning: 'boost::asio::error::misc_category' defined but not used
/usr/local/include/boost/asio/error.hpp:259: warning: 'boost::asio::error::ssl_category' defined but not used
/usr/local/include/boost/system/error_code.hpp:214: warning: 'boost::system::posix_category' defined but not used
/usr/local/include/boost/system/error_code.hpp:215: warning: 'boost::system::errno_ecat' defined but not used
/usr/local/include/boost/system/error_code.hpp:216: warning: 'boost::system::native_ecat' defined but not used
*** Error code 1

Stop in /media/tmp/vcmi-orig/server.
*** Error code 1

Stop in /media/tmp/vcmi-orig.
$ pkg_info -xI boost
boost-jam-1.45.0    Build tool from the boost.org
boost-libs-1.45.0_1 Free portable C++ libraries (without Boost.Python)
boost-python-libs-1.45.0_1 Framework for interfacing Python and C++

VCMI sources from svn r2170

It seems I need to fix configure.ac so that the sdl cflags/ldflags are set before we actually test for their presence :slight_smile:

Regarding the error, it’s missing from the excerpt you posted. The interresting part is the first line that contains “error:”

Oops, I’m sorry. Didn’t noticed that “error” was the part of “error.hpp” filename

CGameHandler.cpp: In member function 'void CGameHandler::newTurn()':
CGameHandler.cpp:1014: error: no matching function for call to 'CCreature::getRandomAmount(int ()())'
../lib/CCreatureHandler.h:69: note: candidates are: int CCreature::getRandomAmount(RanGen&) [with RanGen = int ()()]
CGameHandler.cpp: In member function 'void CGameHandler::run(bool)':
CGameHandler.cpp:1192: warning: comparison is always false due to limited range of data type
CGameHandler.cpp: In member function 'bool CGameHandler::makeBattleAction(BattleAction&)':
CGameHandler.cpp:2914: warning: taking address of temporary
(previous string repeated with different line numbers)
...
/usr/local/include/boost/asio/error.hpp: At global scope:
/usr/local/include/boost/asio/error.hpp:251: warning: 'boost::asio::error::system_category' defined but not used
/usr/local/include/boost/asio/error.hpp:253: warning: 'boost::asio::error::netdb_category' defined but not used
/usr/local/include/boost/asio/error.hpp:255: warning: 'boost::asio::error::addrinfo_category' defined but not used
/usr/local/include/boost/asio/error.hpp:257: warning: 'boost::asio::error::misc_category' defined but not used
/usr/local/include/boost/asio/error.hpp:259: warning: 'boost::asio::error::ssl_category' defined but not used
/usr/local/include/boost/system/error_code.hpp:214: warning: 'boost::system::posix_category' defined but not used
/usr/local/include/boost/system/error_code.hpp:215: warning: 'boost::system::errno_ecat' defined but not used
/usr/local/include/boost/system/error_code.hpp:216: warning: 'boost::system::native_ecat' defined but not used
*** Error code 1

Stop in /media/tmp/vcmi/server.
*** Error code 1

Stop in /media/tmp/vcmi.

I think the problem is here:

CGameHandler.cpp:1014: error: no matching function for call to 'CCreature::getRandomAmount(int ()())'

It could be a gcc issue. freebsd 8 is using gcc 4.3.4.

You could comment the line out in the meantime to make progress (ie. add // in front of it.)

I have gcc 4.6.1

Thanks, it worked! It would affect spawning monsters in server mode I guess?

I’ve committed a patch for the configure error. A simple configure should now work. Could you try ?

I’m sorry but rev2172 has same issue:

checking for sdl-config... yes
checking SDL/SDL.h usability... no
checking SDL/SDL.h presence... no
checking for SDL/SDL.h... no
configure: error: Header not found. Install missing devel package.

configure with modifying LD/CPP flags still ok:

env LDFLAGS=-L/usr/local/lib CPPFLAGS="-I/usr/local/include" ./configure

PS: I’m off for one week (or more) due to vacation, available for further testing when I get back. Take care :]

upd: my vacation is over :frowning:
just a quick note to let you know that rev2220 is still requiers those flags to configure under FreeBSD (in case if you still want feedback about this)

I’m sorry for my English, but I think the problem is are non-standard CC headers.
Configure script work fine in FreeBSD-8.1 with this environment variables (in sh):

env CC="/usr/local/bin/ccache /usr/local/bin/g++46" CXX="/usr/local/bin/ccache /usr/local/bin/g++46" with_boost=yes enable_sdltest=yes LDFLAGS="-L/lib -L/usr/lib -L/usr/local/lib" CPPFLAGS="-I/usr/include -I/usr/local/include -I/usr/local/include/SDL -I/usr/local/include/boost" ./configure

PS: I’m think patch for configure none needed. I not find VCMI port in ports/games, so I’m try develop VCMI port for FreeBSD

@Kestaltar
ok but don’t make such mess as Pelya (he did Android port, pointed for support here and abandoned the port).

I still try compile it with this settings, but received this error message:

  CXX    vcmiclient-CSpellWindow.o
  CXX    vcmiclient-CVideoHandler.o
  CXX    vcmiclient-Graphics.o
  CXX    vcmiclient-GUIClasses.o
  CXX    vcmiclient-mapHandler.o
  CXX    vcmiclient-NetPacksClient.o
  CXXLD  vcmiclient
../lib/.libs/libvcmi.a(libvcmi_la-CLodHandler.o): In function `__gthread_trigger':
/usr/local/lib/gcc46/include/c++//x86_64-portbld-freebsd8.1/bits/gthr-default.h:200: multiple definition of `GVCMIDirs'
vcmiclient-CMT.o:/usr/home/admin/VCMI/SVN/trunk/client/CMT.cpp:108: first defined here
/usr/local/bin/ld: cannot find -ldl
collect2: ld returned 1 exit status

“-ldl” it’s are flag of CXX compiler or LIBS environment? How to fix that?

This flag means "link to library libdl"
It seems that this library is part of libc on FreeBSD.

Try this:
remove -ldl flag from lib/Makefile.am
in configure.ac add this line:

AC_CHECK_LIB(dl, dlopen)

and run autoreconf

I do this, but I think something wrong in configure.ac or I don’t have needed prerequisites (libraries, sources, etc). Because I received this error messages:

$ autoreconf
/usr/local/share/aclocal/smpeg.m4:13: warning: underquoted definition of AM_PATH_SMPEG
/usr/local/share/aclocal/smpeg.m4:13:   run info '(automake)Extending aclocal'
/usr/local/share/aclocal/smpeg.m4:13:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
Use of "do" to call subroutines is deprecated at /usr/local/bin/automake line 986.
Use of "do" to call subroutines is deprecated at /usr/local/bin/automake line 1147.
automake: configure.ac: `PACKAGE' not defined in `configure.ac'
automake: configure.ac: `VERSION' not defined in `configure.ac'
automake: configure.ac: required file `./mkinstalldirs' not found
Makefile.am:3: directory should not contain `/'
automake: client/Makefile.am: not supported: source file `../CCallback.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `../CCallback.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CBattleAnimations.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CBattleAnimations.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CBattleInterface.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CBattleInterface.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CBattleInterfaceClasses.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CBattleInterfaceClasses.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CCreatureAnimation.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./BattleInterface/CCreatureAnimation.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CGuiHandler.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CGuiHandler.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CIntObject.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CIntObject.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CIntObjectClasses.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CIntObjectClasses.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/Geometries.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/Geometries.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CCursorHandler.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/CCursorHandler.h' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/SDL_Extensions.cpp' is in subdirectory
automake: client/Makefile.am: not supported: source file `./UIFramework/SDL_Extensions.h' is in subdirectory
autoreconf: automake failed with exit status: 1

I get sources from svn: svn co vcmi.svn.sourceforge.net/svnroot/vcmi/trunk src
Checked out revision 2656.
I have installed automake versions:

$ pkg_info -Ix automake
automake-1.11.1     GNU Standards-compliant Makefile generator (1.11)
automake-1.4.6_6    GNU Standards-compliant Makefile generator (1.4)
automake-wrapper-20101119 Wrapper script for GNU automake 

Maybe I use wrong version of automake?

Which version you’ve used? 1.4 or 1.11? It work for me with 1.11

Anyway I’ve updated configure script so it should work now. Revert changes and update sources:

I tried to compile new revision:

$ svn revert ./
$ svn up ./
Updating '.':
At revision 2661.

configure script and autoreconf works fine with automake-1.11!

libvcmi compiled without errors (thanks, it’s great work!), but vcmiclient-CVideoHandler.o
compile with many warnings of deprecated declarations:

CXX    vcmiclient-CVideoHandler.o
CVideoHandler.cpp: In constructor 'CVideoPlayer::CVideoPlayer()':
CVideoHandler.cpp:657:2: warning: 'int av_register_protocol2(URLProtocol*, int)' is deprecated (declared at /usr/local/include/libavformat/avio.h:214) -Wdeprecated-declarations]
CVideoHandler.cpp:657:59: warning: 'int av_register_protocol2(URLProtocol*, int)' is deprecated (declared at /usr/local/include/libavformat/avio.h:214) -Wdeprecated-declarations]
CVideoHandler.cpp: In member function 'bool CVideoPlayer::open(std::string, bool, bool)':
CVideoHandler.cpp:692:17: warning: 'int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1170) -Wdeprecated-declarations]
CVideoHandler.cpp:692:67: warning: 'int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1170) -Wdeprecated-declarations]
CVideoHandler.cpp:702:17: warning: 'int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1170) -Wdeprecated-declarations]
CVideoHandler.cpp:702:122: warning: 'int av_open_input_file(AVFormatContext**, const char*, AVInputFormat*, int, AVFormatParameters*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1170) -Wdeprecated-declarations]

after this vcmiclient compile, but collect2 drop with many-many errors:

CCastleInterface.cpp:1078: more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)' follow
vcmiclient-CCastleInterface.o: In function `CBuildWindow::getTextForState(int)':
/usr/home/admin/VCMI/SVN/trunk/client/CCastleInterface.cpp:1446: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
char, std::char_traits<char>, std::allocator<char> >&&)'
vcmiclient-CCastleInterface.o: In function `RecruitArea':
/usr/home/admin/VCMI/SVN/trunk/client/CCastleInterface.cpp:1660: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
vcmiclient-CCastleInterface.o: In function `CBlacksmithDialog':
/usr/home/admin/VCMI/SVN/trunk/client/CCastleInterface.cpp:1831: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'... 

....&&&)':
/usr/local/lib/gcc46/include/c++/bits/stl_list.h:1524: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)'
vcmiclient-GUIClasses.o: In function `pair<std::basic_string<char>, int>':
/usr/local/lib/gcc46/include/c++/bits/stl_pair.h:137: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
vcmiclient-mapHandler.o: In function `pair<std::basic_string<char>, CDefEssential*, void>':
/usr/local/lib/gcc46/include/c++/bits/stl_pair.h:132: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
vcmiclient-mapHandler.o: In function `pair<std::basic_string<char>, CDefEssential*>':
/usr/local/lib/gcc46/include/c++/bits/stl_pair.h:137: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
/usr/local/lib/gcc46/include/c++/bits/stl_pair.h:137: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)'
collect2: ld returned 1 exit status

gcc version used:

$ gcc46 --version
gcc46 (FreeBSD Ports Collection) 4.6.3 20111202 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Maybe I need to use gcc47 with special flags? Like:

CXXFLAGS = -Wall -I /usr/local/lib/gcc47/include/ -O2 -std=c++0x