Re: [opensuse] where to place the library glib
--- Ven 30/10/09, David Haller
Da: David Haller
Oggetto: Re: [opensuse] where to place the library glib A: "SuSE Help" Data: Venerdì 30 ottobre 2009, 01:33 Hello, On Thu, 29 Oct 2009, Maura Monville wrote:
mauede@bordighera:~/miRTA-Dir/Parini-Dir/galopps/galopps3.2.4.Parini/miRTA_MEM> gcc miRTA_MEM-main.c -o miRTA_MEM
In file included from miRTA_MEM-main.c:9: /usr/local/include/g_arraylist.h:1:18: error: glib.h: No such file or directory
You need to tell gcc where to look for headers -- and only use the standard form of includes in your code. And also how to link with glib.
==== #include
==== $ gcc $(pkg-config --cflags --libs glib-2.0) miRTA_MEM-main.c -o miRTA_MEM
HTH, -dnh
My short program contains #include
-- Every time I hear someone whining about vi or emacs, I give them ed to play with. Shuts them up PDQ. -- stevo -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
* Maura Monville (mauede@yahoo.com) [20091030 14:05]:
/usr/lib/pkgconfig/glib.pc
You have to ask pkg-config for the ncessary compiler flags. For compiling So for compiling you add $(pkg-config --cflags glib-2.0` to the gcc commandline and for linking you add $(pkg-config --libs glib-2.0) like David wrote. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 30/10/09 10:04, Maura Monville wrote:
mauede@bordighera:~/miRTA-Dir/Parini-Dir/galopps/galopps3.2.4.Parini/miRTA_MEM> rpm -ql glib
No! , it is glib2-devel....! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
--- Ven 30/10/09, Cristian Rodríguez
Da: Cristian Rodríguez
Oggetto: Re: [opensuse] where to place the library glib A: opensuse@opensuse.org Data: Venerdì 30 ottobre 2009, 15:40 On 30/10/09 10:04, Maura Monville wrote: mauede@bordighera:~/miRTA-Dir/Parini-Dir/galopps/galopps3.2.4.Parini/miRTA_MEM> rpm -ql glib
No! , it is glib2-devel....!
Both are installed. glib and glib2-devel.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, 30 Oct 2009 10:03:13 -0700 (PDT), you wrote:
Both are installed. glib and glib2-devel.
WRONG! What you need are glib2 and glib2-devel. Then gcc -Wall -O2 -D_FORTIFY_SOURCE=2 \ $(pkg-config --cflags --libs glib-2.0) miRTA_MEM-main.c -o miRTA_MEM While "-Wall -O2 -D_FORTIFY_SOURCE=2" isn't strictly necessary, I'd strongly adise to *always* use at least -Wall and -D_FORTIFY_SOURCE=2 . And please read the pkg-config man page! Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 30/10/09 17:13, Philipp Thomas wrote:
While "-Wall -O2 -D_FORTIFY_SOURCE=2" isn't strictly necessary, I'd strongly adise to *always* use at least -Wall and -D_FORTIFY_SOURCE=2 . And please read the pkg-config man page!
I suggest to use this: gcc -Wall $(rpm --eval %optflags) $(pkg-config --cflags glib-2.0) miRTA_MEM-main.c $(pkg-config --libs glib-2.0) -o miRTA_MEM -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (4)
-
Cristian Rodríguez
-
Maura Monville
-
Philipp Thomas
-
Philipp Thomas