comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Re: Help with my first GPRbuild file please
Date: Thu, 3 May 2012 13:00:11 -0700 (PDT)
Date: 2012-05-03T13:00:11-07:00	[thread overview]
Message-ID: <27687929.0.1336075211401.JavaMail.geo-discussion-forums@vbsf10> (raw)
In-Reply-To: <2622641.1774.1336074277508.JavaMail.geo-discussion-forums@vbq19>

On Thursday, May 3, 2012 3:44:37 PM UTC-4, Patrick wrote:
> Hi Everyone
> 
> I am trying to move a makefile to GPRbuild. I am having some trouble with a C file. It includes the gstreamer library in some C code. In a Makefile pkg-config is used. I tried putting `pkg-config --cflags gstreamer-0.10  --libs gstreamer-0.10` in the compiler switches attribute but it failed. I tried copying in the results of copying pkg-config into my gpr file but it failed to.
> 
> If I copy the output when I run gpr:
> gcc-4.4 -c -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gstreamer-0.10 -I/usr/include/libxml2  
> -pthread -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0  audio_player.c
> 
> It works just fine
> 
> Here is my gpr file:
> 
> project C_Mess is
>    for Languages    use ( "C");
>    for Source_Files use ("audio_player.c");
> package Compiler is
> 
>    for Switches ("audio_player.c") use ("-pthread",
>                                         " -I/usr/include/glib-2.0",
>                                         " -I/usr/lib/x86_64-linux-gnu/glib-2.0/include",
>                                         " -I/usr/include/gstreamer-0.10", 
>                                         "-I/usr/include/libxml2",
>                                         "-pthread",
>                                         " -lgstreamer-0.10",
>                                         " -lgobject-2.0",
>                                         " -lgmodule-2.0",
>                                         " -lxml2",
>                                         " -lgthread-2.0",
>                                         " -lrt",
>                                         " -lglib-2.0 " ) ;
> 
> end Compiler ;
> 
> end C_Mess;
> 
> 
> Could someone help me firgure this out? If commands are being displayed, are they not passed to the OS for execution? Why is the command failing with GPRbuild but fine by itself?
> 
> Thanks for reading

Because of the '-c' switch, the line you posted will only ever compile the source, and not try and link it into an executable.  GPRBuild, however, compiles everything first (with the -c) and then tries to build everything together, which is probably what is failing in your case.  Generally, it's more convienent to use a separate 'externally built' library project file for libraries instead of specifying link switches directly (which is rife with ordering difficulties), but the actual error you get would help to clarify things.

-sb



  reply	other threads:[~2012-05-03 20:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-03 19:44 Help with my first GPRbuild file please Patrick
2012-05-03 20:00 ` sbelmont700 [this message]
2012-05-03 20:31   ` Patrick
2012-05-03 20:49     ` Ludovic Brenta
2012-05-03 20:49     ` Robert A Duff
2012-05-03 20:54       ` sbelmont700
2012-05-03 20:55       ` Patrick
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox