From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2943 invoked by alias); 9 Mar 2014 22:59:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 2926 invoked by uid 48); 9 Mar 2014 22:59:12 -0000 From: "zosrothko at orange dot fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgcc/60475] undefined reference to `__gxx_personality_seh0' Date: Sun, 09 Mar 2014 22:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgcc X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zosrothko at orange dot fr X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg00726.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60475 --- Comment #3 from zosrothko at orange dot fr --- (In reply to Jonathan Wakely from comment #1) > (In reply to zosrothko from comment #0) > > $ gcc -xc++ -std=gnu++11 -o foo foo.c > > To link a C++ program you should explicitly link to the C++ runtime library, > using -lstdc++, or use g++ which does that automatically. > > (If your source file is C++ why is your file called foo.c instead of having > a C++ file extension?) because the story starts with a C program. Here the point: there is a problem with the declaration of snprintf with the std=c++11 in c++. Thus I started to test first with gcc and the std(c90, c89), then I forget to switch to g++ for testing the std(c++11,gnu++1). Thus as the gcc -xc++ -std=gnu++11 -c foo.c was compiling without error, I just wanted to execute it. My mistake.... Sorry for the noise...By the way, the error on snprintf not declared is invalid. $ gcc -xc -std=c90 -c foo.c $ gcc -xc -std=c89 -c foo.c $ $ gcc -xc++ -std=c++11 -c foo.c foo.c: In function 'int main()': foo.c:5:27: error: 'snprintf' was not declared in this scope snprintf(buf, 10, "%i", 0); $ $ gcc -xc++ -std=gnu++11 -c foo.c $