* Help with my first GPRbuild file please
@ 2012-05-03 19:44 Patrick
2012-05-03 20:00 ` sbelmont700
0 siblings, 1 reply; 7+ messages in thread
From: Patrick @ 2012-05-03 19:44 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help with my first GPRbuild file please
2012-05-03 19:44 Help with my first GPRbuild file please Patrick
@ 2012-05-03 20:00 ` sbelmont700
2012-05-03 20:31 ` Patrick
0 siblings, 1 reply; 7+ messages in thread
From: sbelmont700 @ 2012-05-03 20:00 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help with my first GPRbuild file please
2012-05-03 20:00 ` sbelmont700
@ 2012-05-03 20:31 ` Patrick
2012-05-03 20:49 ` Ludovic Brenta
2012-05-03 20:49 ` Robert A Duff
0 siblings, 2 replies; 7+ messages in thread
From: Patrick @ 2012-05-03 20:31 UTC (permalink / raw)
Hi sb
Thanks for responding to my post. here is the full command and error:
: gprbuild -v C_Mess.gpr
GPRBUILD 1.3.0 (Debian 1.3.0-2) (20090421) (x86_64-linux-gnu)
Copyright (C) 2004-2009, Free Software Foundation, Inc.
gprconfig --batch -o /media/fast60/Programming/Anak/C_Mess/auto.cgpr --target=x86_64-linux --config=c,,
Creating configuration file: /media/fast60/Programming/Anak/C_Mess/auto.cgpr
Checking configuration /media/fast60/Programming/Anak/C_Mess/auto.cgpr
Checking project file "c_mess"
Changing to object directory of "c_mess": "/media/fast60/Programming/Anak/C_Mess"
Checking /media/fast60/Programming/Anak/C_Mess/audio_player.c ...
-> object file /media/fast60/Programming/Anak/C_Mess/audio_player.o does not exist
CPATH = /media/fast60/Programming/Anak/C_Mess
/usr/bin/gcc-4.4 -c -x 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 -Wp,-MMD,audio_player.d /media/fast60/Programming/Anak/C_Mess/audio_player.c
gcc-4.4: -I/usr/include/glib-2.0: No such file or directory
gcc-4.4: -I/usr/lib/x86_64-linux-gnu/glib-2.0/include: No such file or directory
gcc-4.4: -I/usr/include/gstreamer-0.10: No such file or directory
gcc-4.4: -lgstreamer-0.10: No such file or directory
gcc-4.4: -lgobject-2.0: No such file or directory
gcc-4.4: -lgmodule-2.0: No such file or directory
gcc-4.4: -lxml2: No such file or directory
gcc-4.4: -lgthread-2.0: No such file or directory
gcc-4.4: -lrt: No such file or directory
gcc-4.4: -lglib-2.0 : No such file or directory
/media/fast60/Programming/Anak/C_Mess/audio_player.c:1: fatal error: gst/gst.h: No such file or directory
compilation terminated.
gprbuild: *** compilation phase failed
I'll try to rework this as a library too, thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help with my first GPRbuild file please
2012-05-03 20:31 ` Patrick
@ 2012-05-03 20:49 ` Ludovic Brenta
2012-05-03 20:49 ` Robert A Duff
1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Brenta @ 2012-05-03 20:49 UTC (permalink / raw)
Patrick writes on comp.lang.ada:
> : gprbuild -v C_Mess.gpr
> GPRBUILD 1.3.0 (Debian 1.3.0-2) (20090421) (x86_64-linux-gnu)
> Copyright (C) 2004-2009, Free Software Foundation, Inc.
> gprconfig --batch -o /media/fast60/Programming/Anak/C_Mess/auto.cgpr --target=x86_64-linux --config=c,,
> Creating configuration file: /media/fast60/Programming/Anak/C_Mess/auto.cgpr
> Checking configuration /media/fast60/Programming/Anak/C_Mess/auto.cgpr
> Checking project file "c_mess"
> Changing to object directory of "c_mess": "/media/fast60/Programming/Anak/C_Mess"
> Checking /media/fast60/Programming/Anak/C_Mess/audio_player.c ...
> -> object file /media/fast60/Programming/Anak/C_Mess/audio_player.o does not exist
> CPATH = /media/fast60/Programming/Anak/C_Mess
> /usr/bin/gcc-4.4 -c -x 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 -Wp,-MMD,audio_player.d /media/fast60/Programming/Anak/C_Mess/audio_player.c
> gcc-4.4: -I/usr/include/glib-2.0: No such file or directory
> gcc-4.4: -I/usr/lib/x86_64-linux-gnu/glib-2.0/include: No such file or directory
> gcc-4.4: -I/usr/include/gstreamer-0.10: No such file or directory
> gcc-4.4: -lgstreamer-0.10: No such file or directory
> gcc-4.4: -lgobject-2.0: No such file or directory
> gcc-4.4: -lgmodule-2.0: No such file or directory
> gcc-4.4: -lxml2: No such file or directory
> gcc-4.4: -lgthread-2.0: No such file or directory
> gcc-4.4: -lrt: No such file or directory
> gcc-4.4: -lglib-2.0 : No such file or directory
> /media/fast60/Programming/Anak/C_Mess/audio_player.c:1: fatal error: gst/gst.h: No such file or directory
> compilation terminated.
> gprbuild: *** compilation phase failed
Have you installed the package libgstreamer0.10-dev, which depends on
all the other -dev packages and provides the directory
/usr/include/gstreamer-0.10 and its contents as well as the
libgstreamer0.10.so symbolic link?
If not, how did you get the "pkg-config --cflags gstreamer-0.10" to
work? I thought pkg-config relied on a file provided by the -dev
package, too. I'm confused because you seem to have the include files
of libgstreamer0.10 somewhere but then gcc-4.4 does not find them where
pkg-config says they are.
--
Ludovic Brenta.
The stakeholders 200% strategize Control Information Systems, while the
human resources benchmark the prospective bandwidth across the spheres.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help with my first GPRbuild file please
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
1 sibling, 2 replies; 7+ messages in thread
From: Robert A Duff @ 2012-05-03 20:49 UTC (permalink / raw)
Patrick <patrick@spellingbeewinnars.org> writes:
> gcc-4.4: -I/usr/include/glib-2.0: No such file or directory
It's looking for a file called " -I/usr/include/glib-2.0".
^
|
extra blank
That doesn't start with "-", so it's not a switch.
So it must be a file name, right?
Computers can take things awfully literally sometimes. ;-)
You should remove the extraneous blanks from the
arguments in your project file.
- Bob
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help with my first GPRbuild file please
2012-05-03 20:49 ` Robert A Duff
@ 2012-05-03 20:54 ` sbelmont700
2012-05-03 20:55 ` Patrick
1 sibling, 0 replies; 7+ messages in thread
From: sbelmont700 @ 2012-05-03 20:54 UTC (permalink / raw)
On Thursday, May 3, 2012 4:49:32 PM UTC-4, Robert A Duff wrote:
> Patrick
> writes:
>
> > gcc-4.4: -I/usr/include/glib-2.0: No such file or directory
>
> It's looking for a file called " -I/usr/include/glib-2.0".
> ^
> |
> extra blank
>
> That doesn't start with "-", so it's not a switch.
> So it must be a file name, right?
> Computers can take things awfully literally sometimes. ;-)
>
> You should remove the extraneous blanks from the
> arguments in your project file.
>
> - Bob
Ah, good catch...Also, for what it's worth, GPRBuild also let's you specify a section of 'linker' switches, which would perhaps be best suited to the linker-specific stuff.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help with my first GPRbuild file please
2012-05-03 20:49 ` Robert A Duff
2012-05-03 20:54 ` sbelmont700
@ 2012-05-03 20:55 ` Patrick
1 sibling, 0 replies; 7+ messages in thread
From: Patrick @ 2012-05-03 20:55 UTC (permalink / raw)
Hi Bob
That was it! I'm so dumb. Thanks very much!
Have a great day
Thanks for your post too Ludovic
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-05-03 21:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 19:44 Help with my first GPRbuild file please Patrick
2012-05-03 20:00 ` sbelmont700
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox