From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/2] daemon: Fix '--version'. Date: Thu, 01 Sep 2016 14:15:22 +0200 Message-ID: <871t13q0it.fsf@gnu.org> References: <87fupvx83x.fsf@gmail.com> <87vayjy2nq.fsf@gnu.org> <8760qi282l.fsf@gmail.com> <877fawk5fv.fsf@gnu.org> <87pooo3zpk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfQu3-0004Gs-JQ for guix-devel@gnu.org; Thu, 01 Sep 2016 08:15:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfQtx-0004Fd-IZ for guix-devel@gnu.org; Thu, 01 Sep 2016 08:15:30 -0400 In-Reply-To: <87pooo3zpk.fsf@gmail.com> (Alex Vong's message of "Thu, 01 Sep 2016 14:23:51 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Alex Vong Cc: guix-devel@gnu.org Alex Vong skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] >> #include >> >> const char *argp_program_version =3D "foo"; >> const char *argp_program_bug_address =3D "foo@example.org"; >> >> static const struct argp_option options[] =3D >> { >> { "system", 's', "SYSTEM", 0, >> "assume SYSTEM as the current system type" }, >> { 0, 0, 0, 0, 0 } >> }; >> >> static const struct argp argp =3D >> { >> options, NULL, >> NULL, "doc", >> NULL, NULL, >> NULL >> }; >> >> int >> main (int argc, char *argv[]) >> { >> argp_parse (&argp, argc, argv, 0, 0, 0); >> return 0; >> } > > I think you have isolated the problem! This test case does not work for > me. > > > I get the following output after building with > (g++ -O2 -flto version.cxx): What if you compile with =E2=80=98gcc=E2=80=99 (and rename to foo.c) instea= d of =E2=80=98g++=E2=80=99? It might be a symbol visibility problem, or name mangling issue. Ludo=E2=80=99.