From owner-freebsd-questions@FreeBSD.ORG Mon Aug 31 12:14:20 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4429106566B for ; Mon, 31 Aug 2009 12:14:20 +0000 (UTC) (envelope-from ml@netfence.it) Received: from cp-out8.libero.it (cp-out8.libero.it [212.52.84.108]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8DE8FC14 for ; Mon, 31 Aug 2009 12:14:20 +0000 (UTC) Received: from soth.ventu (151.51.189.10) by cp-out8.libero.it (8.5.107) id 4A79A60C014CA2F7; Mon, 31 Aug 2009 14:14:12 +0200 Received: from alamar.ventu (alamar.ventu [10.1.2.18]) by soth.ventu (8.14.3/8.14.2) with ESMTP id n7V98HFQ030680; Mon, 31 Aug 2009 11:09:02 +0200 (CEST) (envelope-from ml@netfence.it) Message-ID: <4A9B9300.80603@netfence.it> Date: Mon, 31 Aug 2009 11:08:16 +0200 From: Andrea Venturoli User-Agent: Thunderbird 2.0.0.23 (X11/20090828) MIME-Version: 1.0 To: Daniel Underwood References: <4A71455C.2070506@netfence.it> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: OpenMP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2009 12:14:20 -0000 Daniel Underwood ha scritto: > Did you add the "-fopenmp" flag to both the compiler and the linker? > Both need it. Thanks, this solves any compiling/linking problem. Now my compiling session looks like this: g++42 -c -pipe -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wconversion -Wsign-compare -g -march=athlon64 -ffloat-store -fopenmp -Wall -Wno-unused -o libobj.o libobj.cpp ar rs lib.a libobj.o ar: creating lib.a g++42 -c -pipe -Wall -Wextra -Wpointer-arith -Wwrite-strings -Wconversion -Wsign-compare -g -march=athlon64 -ffloat-store -fopenmp -Wall -Wno-unused -o test.o test.cpp g++42 -o test.exe test.o lib.a -L/usr/local/lib -lstdc++ -lm -lGL -lc -fopenmp No errors or warning are printed while compiling/linking. However, the program crashes with a Bad system call as soon as it calls std::getline. bye & Thanks av.