Mailinglist Archive: opensuse (1597 mails)

< Previous Next >
[opensuse] where to place the library glib
  • From: Maura Monville <mauede@xxxxxxxxx>
  • Date: Thu, 29 Oct 2009 10:27:15 -0700 (PDT)
  • Message-id: <234668.88084.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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


/*---------------------------------------------------------------------------*/
/****************************** Main program *******************************/
/* */
/* Funtions: read i miRNA files */
/* generate miRANDA input files "query.fasta" and "reference.fast" */
/* generate Validated/Predicted data set */
/*-------------------------------------------------------------------------- */
/*#include <glib.h>*/
#include "/usr/local/include/g_arraylist.h"
#include "/usr/include/glib-2.0/glib.h"
/*#include <mirta.h>*/
#include <string.h>
#include <stdlib.h>
#include <glib/gstdio>



enum fasta_parse_stare {NAME, DESCRIPTION, SEQUENCE};

fasta_sequence* mirta_read_fasta_sequence (FILE* fp) {
fasta_sequence* f_seq;
gchar c;
gint state = NAME;

GString* name = g_string_new("");
GString* description = g_string_new("");
GString* sequence = g_string_new("");

if ((c = fgetc (fp)) == EOF) {
ungetc(c,fp);
goto error_rollback;
}
ungetc(c,fp);

/*read gene name*/

while ((c = fgetc (fp)) != EOF) {
switch (state) {
case NAME:
/*check if c is the separator between name and
description*/
if (c == '\t' || c == '|' || c == ' ') {
state = DESCRIPTION;
} else if (c == '>') {
break;
} /*BIG FAT WARNING: this is not compatible
with windows or mac file format*/
else if (c == '\n') {
state = SEQUENCE;
}else {
g_string_append_c(name,c);
}
break;

case DESCRIPTION:
/*BIG FAT WARNING: this is not compatible with
windows or mac file format*/
if (c == '\n') {
state = SEQUENCE;
} else {
g_string_append_c(description,c);
}
break;

case SEQUENCE:
/*this is the beginning of a new fasta
sequence*/
if (c == '>') {
ungetc(c,fp);
goto end_sequence;
} else {
if ((c != '\n') && (c != ' ') && (c !=
'\r')) {
if (((c >= 'a') && (c <= 'z')))
{
c += 'A' - 'a';
}
if (((c >= 'A') && (c <= 'Z'))
|| (c == '*')) {

g_string_append_c(sequence,c);
} else {
g_fprintf
(stderr,"Error: Sequence file contains non-standard or lowercase characters
%c\n", c);
goto error_rollback;
}
}
}
break;


}



}

end_sequence:


f_seq = g_new0(fasta_sequence,1);
f_seq->id = name->str;
f_seq->description = description->str;
f_seq->sequence = sequence->str;
f_seq->sequence_len = sequence->len;

g_string_free(name,FALSE);
g_string_free(description,FALSE);
g_string_free(sequence,FALSE);
return f_seq;


error_rollback:

g_string_free(name,TRUE);
g_string_free(description,TRUE);
g_string_free(sequence,TRUE);
return NULL;
}


/*--------------------------------------------------------------------------------

gint main(gint argc, gchar** argv) {

g_arraylist* miRNA_list = g_arraylist_new();

g_arraylist* query_list = g_arraylist_new();
g_arraylist* reference_list = g_arraylist_new();
g_arraylist* results;

fasta_sequence* miRNA, query, *reference;

mirta_parameters par;

if (argc < 4) {
g_fprintf(stderr,"parametri errati!!!\n");
exit(-1);
}

FILE* miRNA_in = g_fopen(argv[1],"r");

// FILE* query_in = g_fopen(argv[1],"r");
// FILE* query_in = g_fopen(argv[1],"r");
// FILE* reference_in = g_fopen(argv[2],"r");
// GError **err = NULL;

while((miRNA = mirta_read_fasta_sequence(miRNA_in)) != NULL) {
g_arraylist_add(miRNA_list,(gpointer) miRNA);
}



// while((query = mirta_read_fasta_sequence(query_in)) != NULL) {
// g_arraylist_add(query_list,(gpointer) query);
// }

// while((reference = mirta_read_fasta_sequence(reference_in)) != NULL) {
// g_arraylist_add(reference_list,(gpointer) reference);
// }


}
< Previous Next >