[opensuse] where to place the library glib
I am brushing up my C coding capability ... if any (???) I started up with a stand-alone simple program (see attachment) hich I compile through one simple command line. The compiler cannot resolve the include statement about elements that belong to glib, no matter how I reshuffle such statements (error messages pasted at the bottom of this message). Since an assistant professor and I installed the glib in such a way as to make the undocumented code, developed by a student who left some months ago, work somehow ... I am afraid we messed up the glib installation so that instead of having its pieces stored in the standard system files its pieces were spread elsewhere therefore the gcc compiler cannot find them. My question is: where is the glib expected to be installed by default (as gcc expects) ? How can I make up for the mess we did ? I mean, shall I un-install glib (how) and then reinstall it again following the standard pathway ? Many thanks, Maura 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 In file included from miRTA_MEM-main.c:9: /usr/local/include/g_arraylist.h:5: error: expected specifier-qualifier-list before ‘GPtrArray’ /usr/local/include/g_arraylist.h:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_arraylist_remove_index’ /usr/local/include/g_arraylist.h:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_arraylist_remove’ /usr/local/include/g_arraylist.h:15: error: expected declaration specifiers or ‘...’ before ‘gpointer’ /usr/local/include/g_arraylist.h:16: error: expected declaration specifiers or ‘...’ before ‘GCompareFunc’ /usr/local/include/g_arraylist.h:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_arraylist_length’ /usr/local/include/g_arraylist.h:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘g_arraylist_get’ /usr/local/include/g_arraylist.h:19: error: expected declaration specifiers or ‘...’ before ‘GFunc’ In file included from miRTA_MEM-main.c:10: /usr/include/glib-2.0/glib.h:32:26: error: glib/galloca.h: No such file or directory /usr/include/glib-2.0/glib.h:33:25: error: glib/garray.h: No such file or directory /usr/include/glib-2.0/glib.h:34:30: error: glib/gasyncqueue.h: No such file or directory /usr/include/glib-2.0/glib.h:35:26: error: glib/gatomic.h: No such file or directory /usr/include/glib-2.0/glib.h:36:29: error: glib/gbacktrace.h: No such file or directory /usr/include/glib-2.0/glib.h:37:26: error: glib/gbase64.h: No such file or directory /usr/include/glib-2.0/glib.h:38:32: error: glib/gbookmarkfile.h: No such file or directory /usr/include/glib-2.0/glib.h:39:25: error: glib/gcache.h: No such file or directory /usr/include/glib-2.0/glib.h:40:28: error: glib/gchecksum.h: No such file or directory /usr/include/glib-2.0/glib.h:41:30: error: glib/gcompletion.h: No such file or directory /usr/include/glib-2.0/glib.h:42:27: error: glib/gconvert.h: No such file or directory /usr/include/glib-2.0/glib.h:43:27: error: glib/gdataset.h: No such file or directory /usr/include/glib-2.0/glib.h:44:24: error: glib/gdate.h: No such file or directory /usr/include/glib-2.0/glib.h:45:23: error: glib/gdir.h: No such file or directory /usr/include/glib-2.0/glib.h:46:25: error: glib/gerror.h: No such file or directory /usr/include/glib-2.0/glib.h:47:29: error: glib/gfileutils.h: No such file or directory /usr/include/glib-2.0/glib.h:48:24: error: glib/ghash.h: No such file or directory /usr/include/glib-2.0/glib.h:49:24: error: glib/ghook.h: No such file or directory /usr/include/glib-2.0/glib.h:50:29: error: glib/giochannel.h: No such file or directory /usr/include/glib-2.0/glib.h:51:27: error: glib/gkeyfile.h: No such file or directory /usr/include/glib-2.0/glib.h:52:24: error: glib/glist.h: No such file or directory /usr/include/glib-2.0/glib.h:53:26: error: glib/gmacros.h: No such file or directory /usr/include/glib-2.0/glib.h:54:24: error: glib/gmain.h: No such file or directory /usr/include/glib-2.0/glib.h:55:30: error: glib/gmappedfile.h: No such file or directory /usr/include/glib-2.0/glib.h:56:26: error: glib/gmarkup.h: No such file or directory /usr/include/glib-2.0/glib.h:57:23: error: glib/gmem.h: No such file or directory /usr/include/glib-2.0/glib.h:58:28: error: glib/gmessages.h: No such file or directory /usr/include/glib-2.0/glib.h:59:24: error: glib/gnode.h: No such file or directory /usr/include/glib-2.0/glib.h:60:26: error: glib/goption.h: No such file or directory /usr/include/glib-2.0/glib.h:61:27: error: glib/gpattern.h: No such file or directory /usr/include/glib-2.0/glib.h:62:26: error: glib/gprimes.h: No such file or directory /usr/include/glib-2.0/glib.h:63:25: error: glib/gqsort.h: No such file or directory /usr/include/glib-2.0/glib.h:64:25: error: glib/gquark.h: No such file or directory /usr/include/glib-2.0/glib.h:65:25: error: glib/gqueue.h: No such file or directory /usr/include/glib-2.0/glib.h:66:24: error: glib/grand.h: No such file or directory /usr/include/glib-2.0/glib.h:67:23: error: glib/grel.h: No such file or directory /usr/include/glib-2.0/glib.h:68:25: error: glib/gregex.h: No such file or directory /usr/include/glib-2.0/glib.h:69:27: error: glib/gscanner.h: No such file or directory /usr/include/glib-2.0/glib.h:70:28: error: glib/gsequence.h: No such file or directory /usr/include/glib-2.0/glib.h:71:25: error: glib/gshell.h: No such file or directory /usr/include/glib-2.0/glib.h:72:25: error: glib/gslice.h: No such file or directory /usr/include/glib-2.0/glib.h:73:25: error: glib/gslist.h: No such file or directory /usr/include/glib-2.0/glib.h:74:25: error: glib/gspawn.h: No such file or directory /usr/include/glib-2.0/glib.h:75:28: error: glib/gstrfuncs.h: No such file or directory /usr/include/glib-2.0/glib.h:76:26: error: glib/gstring.h: No such file or directory /usr/include/glib-2.0/glib.h:77:29: error: glib/gtestutils.h: No such file or directory /usr/include/glib-2.0/glib.h:78:26: error: glib/gthread.h: No such file or directory /usr/include/glib-2.0/glib.h:79:30: error: glib/gthreadpool.h: No such file or directory /usr/include/glib-2.0/glib.h:80:25: error: glib/gtimer.h: No such file or directory /usr/include/glib-2.0/glib.h:81:24: error: glib/gtree.h: No such file or directory /usr/include/glib-2.0/glib.h:82:25: error: glib/gtypes.h: No such file or directory /usr/include/glib-2.0/glib.h:83:27: error: glib/gunicode.h: No such file or directory /usr/include/glib-2.0/glib.h:84:28: error: glib/gurifuncs.h: No such file or directory /usr/include/glib-2.0/glib.h:85:25: error: glib/gutils.h: No such file or directory miRTA_MEM-main.c:14:23: error: glib/gstdio: No such file or directory miRTA_MEM-main.c:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token miRTA_MEM-main.c:113:1: error: unterminated comment
On Thu, 2009-10-29 at 10:27 -0700, Maura Monville wrote:
I am brushing up my C coding capability ... if any (???) I started up with a stand-alone simple program (see attachment) hich I compile through one simple command line. The compiler cannot resolve the include statement about elements that belong to glib, no matter how I reshuffle such statements (error messages pasted at the bottom of this message).
Is glib-devel installed?
Since an assistant professor and I installed the glib in such a way as to make the undocumented code, developed by a student who left some months ago, work somehow ... I am afraid we messed up the glib installation so that instead of having its pieces stored in the standard system files its pieces were spread elsewhere therefore the gcc compiler cannot find them.
So fix that. Seriously. There is no reason to mess with the glib setup.
My question is: where is the glib expected to be installed by default (as gcc expects) ?
rpm -ql glib rpm -ql glib-devel
How can I make up for the mess we did ? /usr/local/include/g_arraylist.h:1:18: error: glib.h: No such file or directory
/usr/local/.... There is no reason to look for glib stuff in /usr/local -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday, 2009-10-29 at 13:36 -0400, Adam Tauno Williams wrote: ...
How can I make up for the mess we did ? /usr/local/include/g_arraylist.h:1:18: error: glib.h: No such file or directory
/usr/local/.... There is no reason to look for glib stuff in /usr/local
The code has a: #include "/usr/local/include/g_arraylist.h" which I suppose is indeed local. After correcting the source to: #include <glib.h> #include "/usr/local/include/g_arraylist.h" //#include "/usr/include/glib-2.0/glib.h" //#include <mirta.h> I can attempt a compile: cer@nimrodel:~/bin/ppp> gcc miRTA_MEM-main.c miRTA_MEM-main.c:8:18: error: glib.h: No such file or directory miRTA_MEM-main.c:9:44: error: /usr/local/include/g_arraylist.h: No such file or directory miRTA_MEM-main.c:14:23: error: glib/gstdio: No such file or directory miRTA_MEM-main.c:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token miRTA_MEM-main.c:113:1: error: unterminated comment which fails more "normally". I have installed: glib-1.2.10-710.1 glibc-2.8-14.2 glib2-branding-openSUSE-2.16-15.1 glibc-locale-2.8-14.2 glib2-devel-2.16.3-20.6 glib2-2.16.3-23.1 glibc-devel-2.8-14.2 glib-devel-1.2.10-710.1 glibc-info-2.8-14.2 at least. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkrrKLUACgkQtTMYHG2NR9WV4wCfQETpFv8aCE137Ib0JuFZPU+V vwEAn1gDAfdsQK/p+FAg8hjMgHN23xih =RpKU -----END PGP SIGNATURE-----
On 29/10/09 14:27, Maura Monville wrote:
I am brushing up my C coding capability ... if any (???) I started up with a stand-alone simple program (see attachment) hich I compile through one simple command line. The compiler cannot resolve the include statement about elements that belong to glib, no matter how I reshuffle such statements (error messages pasted at the bottom of this message). Since an assistant professor and I installed the glib in such a way as to make the undocumented code, developed by a student who left some months ago, work somehow ... I am afraid we messed up the glib installation so that instead of having its pieces stored in the standard system files its pieces were spread elsewhere therefore the gcc compiler cannot find them.
My question is: where is the glib expected to be installed by default (as gcc expects) ? How can I make up for the mess we did ? I mean, shall I un-install glib (how) and then reinstall it again following the standard pathway ?
Many thanks, Maura
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
is glib2-devel installed ? how are you trying to compile and link the code ? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
--- Gio 29/10/09, Cristian Rodríguez <crrodriguez@opensuse.org> ha scritto:
Da: Cristian Rodríguez <crrodriguez@opensuse.org> Oggetto: Re: [opensuse] where to place the library glib A: opensuse@opensuse.org Data: Giovedì 29 ottobre 2009, 20:19 On 29/10/09 14:27, Maura Monville wrote:
I am brushing up my C coding capability ... if any (???) I started up with a stand-alone simple program (see attachment) hich I compile through one simple command line. The compiler cannot resolve the include statement about elements that belong to glib, no matter how I reshuffle such statements (error messages pasted at the bottom of this message). Since an assistant professor and I installed the glib in such a way as to make the undocumented code, developed by a student who left some months ago, work somehow ... I am afraid we messed up the glib installation so that instead of having its pieces stored in the standard system files its pieces were spread elsewhere therefore the gcc compiler cannot find them.
My question is: where is the glib expected to be installed by default (as gcc expects) ? How can I make up for the mess we did ? I mean, shall I un-install glib (how) and then reinstall it again following the standard pathway ?
Many thanks, Maura
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
is glib2-devel installed ? how are you trying to compile and link the code ?
I will check. What is not clear to me is why the development environment should be installed. The code I am in charge to fix makes use of some glib funtions to read/write data from/to files, create arrays of structures, and access a database. Why is the development environment necesary ? Do the glib header files ".h" require the glib development package ? I thought that glib-develop would be required to implement some new glib function or modify an existent glib function. The guy who made such a mess was just using some glib primitives. Sorry. I am confused. Thank you for your patience, Maura
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
__________________________________________________ Do You Yahoo!? Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi http://mail.yahoo.it -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 29/10/09 21:08, Maura Monville wrote: .
Why is the development environment necesary ?
To compile the code...
Do the glib header files ".h" require the glib development package ?
header files are _provided_ by glib2-devel
Sorry. I am confused.
I think you are not doing enough homework. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, 30 Oct 2009 00:08:59 +0000 (GMT), you wrote:
Why is the development environment necesary ?
Because you are doing development work. For running the program you only need the package containing the runtime library b ut for compilinig applications you need headers and and library symlinks in order to succeed.
Do the glib header files ".h" require the glib development package ?
They contain them. Development package means it contains all filles needed to develop applications that use glib.
I thought that glib-develop would be required to implement some new glib function or modify an existent glib function.
For that you'd need the source code and that is in the .src.rpm and not the -devel one.
Sorry. I am confused.
Yes, seems you need to educate yourself a bit further. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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 <glib.h> ==== $ gcc $(pkg-config --cflags --libs glib-2.0) miRTA_MEM-main.c -o miRTA_MEM HTH, -dnh -- 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
On 29/10/09 22:33, David Haller wrote:
$ gcc $(pkg-config --cflags --libs glib-2.0) miRTA_MEM-main.c -o miRTA_MEM
Nope, see http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Fri, 30 Oct 2009, Cristian Rodríguez wrote:
On 29/10/09 22:33, David Haller wrote:
$ gcc $(pkg-config --cflags --libs glib-2.0) miRTA_MEM-main.c -o miRTA_MEM
Nope, see
http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html
Works here. Don't ask me why. But generally you're right, of course. -dnh -- $max = [$a => $b] -> [ $a <= $b ]; ## Simon Cozens -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 30/10/09 20:48, David Haller wrote:
Hello,
On Fri, 30 Oct 2009, Cristian Rodríguez wrote:
On 29/10/09 22:33, David Haller wrote:
$ gcc $(pkg-config --cflags --libs glib-2.0) miRTA_MEM-main.c -o miRTA_MEM
Nope, see
http://www.network-theory.co.uk/docs/gccintro/gccintro_18.html
Works here. Don't ask me why.
It "works", but it is incorrect, if you export SUSE_ASNEEDED=1 (or link with --as-needed it will break. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Fri, 30 Oct 2009 21:48:10 -0300, you wrote:
It "works", but it is incorrect, if you export SUSE_ASNEEDED=1 (or link with --as-needed it will break.
What's wrong with it, please expand a bit. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Sat, 31 Oct 2009, Philipp Thomas wrote:
On Fri, 30 Oct 2009 21:48:10 -0300, you wrote:
It "works", but it is incorrect, if you export SUSE_ASNEEDED=1 (or link with --as-needed it will break.
What's wrong with it, please expand a bit.
$ gcc -Wl,-t -Wl,--as-needed -Wall -W $(pkg-config --cflags \ --libs glib-2.0) glibtest.c -o glibtest [..] /usr/lib/gcc/i586-suse-linux/4.3/crtbegin.o -lglib-2.0 (/usr/lib/gcc/i586-suse-linux/4.3/../../../libglib-2.0.so) /tmp/ccrDplQk.o [..] /tmp/ccMYnI9r.o: In function `main': glibtest.c:(.text+0x19): undefined reference to `g_string_new' glibtest.c:(.text+0x4b): undefined reference to `g_string_free' collect2: ld returned 1 exit status $ gcc -Wl,-t -Wl,--as-needed -Wall -W $(pkg-config --cflags glib-2.0) \ glibtest.c $(pkg-config --libs glib-2.0) -o glibtest [..] /usr/lib/gcc/i586-suse-linux/4.3/crtbegin.o /tmp/ccAEZHjM.o -lglib-2.0 (/usr/lib/gcc/i586-suse-linux/4.3/../../../libglib-2.0.so) [..] $ -dnh -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 31 Oct 2009 23:25:50 +0100, you wrote:
glibtest.c:(.text+0x19): undefined reference to `g_string_new' glibtest.c:(.text+0x4b): undefined reference to `g_string_free'
Yeah, temporary blockade :) Library always after the objects. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Adam Tauno Williams
-
Carlos E. R.
-
Cristian Rodríguez
-
David Haller
-
Maura Monville
-
Philipp Thomas