Overview
Features
Download
Documentation
Community
Add-Ons & Services

Building Linux newer version gcc c++11 [Solved]

Please post support and help requests here.

Building Linux newer version gcc c++11 [Solved]

Postby zarnce » 08 Jan 2013, 23:24

I am currently trying to build Poco (Foundation and Net) on Linux (Ubuntu 12.04). I am using a newer version of gcc (4.7.2) that is located in /opt. I copied the build/config/Linux, changed the gcc and g++ paths and then added '-std=c++11' to CXXFLAGS. I then build with the following commands:

./configure --config=Ubuntu --prefix=$(pwd)/package --omit=Data,XML,Util --no-tests --no-samples
make -j 22

I then get the following error:

** Compiling src/RefCountedObject.cpp (debug, shared)
/opt/gcc-4.7.2/bin/g++ -Iinclude -I/home/user/poco-1.4.5/CppUnit/include -I/home/user/poco-1.4.5/Foundation/include -I/home/user/poco-1.4.5/Util/include -I/home/user/poco-1.4.5/XML/include -I/home/user/poco-1.4.5/Net/include -std=c++11 -Wall -Wno-sign-compare -DPOCO_BUILD_HOST=hostname -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPOCO_HAVE_FD_EPOLL -g -D_DEBUG -fPIC -c src/RefCountedObject.cpp -o /home/user/poco-1.4.5/Foundation/obj/Linux/x86_64/debug_shared/RefCountedObject.o
src/NumberParser.cpp: In static member function ‘static bool Poco::NumberParser::tryParse64(const string&, Poco::Int64&)’:
src/NumberParser.cpp:127:42: error: unable to find string literal operator ‘operator"" I64_FMT’
src/NumberParser.cpp: In static member function ‘static bool Poco::NumberParser::tryParseUnsigned64(const string&, Poco::UInt64&)’:
src/NumberParser.cpp:144:42: error: unable to find string literal operator ‘operator"" I64_FMT’
src/NumberParser.cpp: In static member function ‘static bool Poco::NumberParser::tryParseHex64(const string&, Poco::UInt64&)’:
src/NumberParser.cpp:161:42: error: unable to find string literal operator ‘operator"" I64_FMT’

When I build with the built in compiler 4.6.3 it compiles cleanly.

Any ideas?

Thanks
Brian
Last edited by zarnce on 09 Jan 2013, 00:18, edited 1 time in total.
zarnce
 
Posts: 12
Joined: 08 Jan 2013, 22:56

Re: Building Linux newer version gcc c++11

Postby alex » 08 Jan 2013, 23:52

Funny thing that Google - turns out, someone has already figured it out.
alex
 
Posts: 1087
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Building Linux newer version gcc c++11

Postby zarnce » 08 Jan 2013, 23:56

Thanks. My searches didn't find that post.

Yet it seems to be a weird answer as I can successfully build with gcc 4.6.3 and '-std=c++0x'. As using gcc 4.7.2 and '-std=c++11' does not work.

Brian
zarnce
 
Posts: 12
Joined: 08 Jan 2013, 22:56

Re: Building Linux newer version gcc c++11 [Solved]

Postby zarnce » 09 Jan 2013, 00:17

Solution:

1) in the Foundation/src/NumberParser.cpp and Foundation/src/NumberFormatter.cpp you need to change "164_FMT" with " I64_FMT". (Place a space after the first double quote)
2) int the build/rules/global file delete $(BINEXT)
3) when using ./configure pass one of the following arguments '--cflags=-std=c++11', '--cflags=-std=c++0x' or '--cflags=-std=gnu++11'

Note: There have been reports of freezing if you use the -j switch.
zarnce
 
Posts: 12
Joined: 08 Jan 2013, 22:56


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron