Re: C++11 program link failure under GCC 4.8.2-1

2014-03-12 Thread zosrothko
Hi Below are the compile time __STRICT_ANSI__ defines for various standards supported by g++ FrancisANDRE@idefix /usr/include $ gcc -xc++ -std=c++0x -dM -E - /dev/null | grep ANSI #define __STRICT_ANSI__ 1 FrancisANDRE@idefix /usr/include $ gcc -xc++ -std=c++11 -dM -E - /dev/null | grep ANSI

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-13 Thread Corinna Vinschen
On Nov 12 18:37, Ryan Johnson wrote: On 12/11/2013 5:30 PM, JonY wrote: Right now, it is guarded by: #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ = 199901L) Which means non-strict mode and C99 mode, snprintf was not part of C++03. I guess (__cplusplus = 201103L) needs to be added to

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-13 Thread Christopher Faylor
On Wed, Nov 13, 2013 at 10:15:02AM +0100, Corinna Vinschen wrote: On Nov 12 18:37, Ryan Johnson wrote: On 12/11/2013 5:30 PM, JonY wrote: Right now, it is guarded by: #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ = 199901L) Which means non-strict mode and C99 mode, snprintf was not part

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-13 Thread Corinna Vinschen
On Nov 13 09:01, Christopher Faylor wrote: On Wed, Nov 13, 2013 at 10:15:02AM +0100, Corinna Vinschen wrote: On Nov 12 18:37, Ryan Johnson wrote: On 12/11/2013 5:30 PM, JonY wrote: Right now, it is guarded by: #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ = 199901L) Which means

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-13 Thread Christopher Faylor
On Wed, Nov 13, 2013 at 04:19:15PM +0100, Corinna Vinschen wrote: On Nov 13 09:01, Christopher Faylor wrote: On Wed, Nov 13, 2013 at 10:15:02AM +0100, Corinna Vinschen wrote: On Nov 12 18:37, Ryan Johnson wrote: On 12/11/2013 5:30 PM, JonY wrote: Right now, it is guarded by: #if

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-12 Thread JonY
On 11/12/2013 07:37, Yucong Sun wrote: Yes, the sha1 matches. sunyc@sunyc-wks /lib/gcc/i686-pc-cygwin/4.8.2 $ sha1sum.exe libstdc++.* f4dfadfddade3aceaf4852cd5db31372ab7ef0d1 *libstdc++.a 963e2a697c3a1a7d036d975b07f4c408bbd1cb2d *libstdc++.dll.a Also I couldn't find GLIB_xxx version

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-12 Thread JonY
On 11/12/2013 10:33, Yucong Sun wrote: I've tried on both 32bit and 64bit clean cygwin install, the result is same. Something is wrong with cygwin's gcc. my configure script by default uses g++ --std=c++11, this still have problem of no snprintf , after I replace all snprintf() with

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-12 Thread Yucong Sun
Good new! I've found the link failure issue, it is caused by -rdynamic sunyc@sunyc-wks ~ $ cat 2.cc #include deque struct tick_event { int i; }; int main() { std::dequetick_event * list; tick_event *a = new tick_event; list.push_back(a); return 0; } sunyc@sunyc-wks ~ $

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-12 Thread JonY
On 11/13/2013 02:35, Yucong Sun wrote: Good new! I've found the link failure issue, it is caused by -rdynamic sunyc@sunyc-wks ~ $ cat 2.cc #include deque struct tick_event { int i; }; int main() { std::dequetick_event * list; tick_event *a = new tick_event;

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-12 Thread Ryan Johnson
On 12/11/2013 5:30 PM, JonY wrote: On 11/13/2013 02:35, Yucong Sun wrote: Good new! I've found the link failure issue, it is caused by -rdynamic sunyc@sunyc-wks ~ $ cat 2.cc #include deque struct tick_event { int i; }; int main() { std::dequetick_event * list; tick_event *a

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-12 Thread Yucong Sun
That's what lead me to use gnu++0x instead. For -rdynamic, apparently it would work for some simple c++ program, just not those with new c++11 features. It would be nice to fix it. Cheers. On Tue, Nov 12, 2013 at 3:37 PM, Ryan Johnson ryan.john...@cs.utoronto.ca wrote: On 12/11/2013 5:30 PM,

C++11 program link failure under GCC 4.8.2-1

2013-11-11 Thread Yucong Sun
Hi, I'm trying to compile a program under cygwin with latest gcc 4.8.2, the program compiles fine, but link failed. I'm suspecting this has something todo with libstdc++ but I couldn't find any document on how to check libstdc++ version (cygwin setup claim it is version 4.8.2 already). Your help

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-11 Thread JonY
On 11/12/2013 06:17, JonY wrote: On 11/12/2013 05:17, Yucong Sun wrote: Hi, I'm trying to compile a program under cygwin with latest gcc 4.8.2, the program compiles fine, but link failed. I'm suspecting this has something todo with libstdc++ but I couldn't find any document on how to check

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-11 Thread Yucong Sun
Yes, the sha1 matches. sunyc@sunyc-wks /lib/gcc/i686-pc-cygwin/4.8.2 $ sha1sum.exe libstdc++.* f4dfadfddade3aceaf4852cd5db31372ab7ef0d1 *libstdc++.a 963e2a697c3a1a7d036d975b07f4c408bbd1cb2d *libstdc++.dll.a Also I couldn't find GLIB_xxx version number in libstdc++.a sunyc@sunyc-wks

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-11 Thread Yucong Sun
I've tried on both 32bit and 64bit clean cygwin install, the result is same. Something is wrong with cygwin's gcc. my configure script by default uses g++ --std=c++11, this still have problem of no snprintf , after I replace all snprintf() with sprintf() , I've met the same linkage problem

Re: C++11 program link failure under GCC 4.8.2-1

2013-11-11 Thread Yucong Sun
(forgot to say) this program compile and links fine on g++ 4.6 ,4.7, 4.8 on ubuntu ,centos, freebsd etc without modification. Cheers. On Mon, Nov 11, 2013 at 6:33 PM, Yucong Sun sunyuc...@gmail.com wrote: I've tried on both 32bit and 64bit clean cygwin install, the result is same. Something