Portál AbcLinuxu, 12. května 2024 19:06


Dotaz: jabber 2 & mu-conference - kompilace

23.4.2004 09:01 zdenek-hbr | skóre: 10 | blog: .
jabber 2 & mu-conference - kompilace
Přečteno: 99×
Odpovědět | Admin
ahoj, snazim se rozjet konferenci v jabber 2. vygooglil jsem si navod, kde pisi, ze mam zkompilovat Jabber Component Runtime (jcr-0.1.2.tar.gz). jenze pri kompilaci mi to hlasi chyby:
I. `pkg-config --cflags glib-2.0` -D_REENTRANT   -c -o jcr_deliver.o jcr_deliver.c
gcc -O2 -g -Wall -I../lib -I. `pkg-config --cflags glib-2.0` -D_REENTRANT   -c -o jcr_elements.o jcr_elements.c
jcr_elements.c: In function `jcr_start_element':
jcr_elements.c:42: parse error before `char'
jcr_elements.c:44: `hashbuf' undeclared (first use in this function)
jcr_elements.c:44: (Each undeclared identifier is reported only once
jcr_elements.c:44: for each function it appears in.)
jcr_elements.c:47: parse error before `cur'
jcr_elements.c:48: `cur' undeclared (first use in this function)
jcr_elements.c: In function `jcr_end_element':
jcr_elements.c:103: parse error before `parent'
jcr_elements.c:104: `parent' undeclared (first use in this function)
make[1]: *** [jcr_elements.o] Error 1

tak jsem prohledaval konference a nasel jsem stejnej dotaz a u nej odpoved s patchem, se kterym vsak vubecnevim co delat. pochpil jsem ze to je porovnani puvodniho a upravenyho souboru, ale jak to slepit dohromady nevim. predem dik za kazdou radu

vypada to takhle:
diff -ur jcr-0.1.2//jcomp/jcr_elements.c jcr-0.1.2-compiles//jcomp/jcr_elements.c
--- jcr-0.1.2//jcomp/jcr_elements.cTue Nov  4 22:42:42 2003
+++ jcr-0.1.2-compiles//jcomp/jcr_elements.cThu Jan 29 17:56:50 2004
@@ -32,6 +32,8 @@
     if (strncasecmp(name, "/stream:/stream", 13) == 0) {
       char *pass = xmlnode_get_data(xmlnode_get_tag(jcr->config,"secret"));
       int i = 0;
+      char hashbuf[41];
+      xmlnode cur;
       if (attrib == NULL) return;
       while (attrib[i] != '\0') {
         if (strncasecmp(attrib[i], "id", 2) == 0)
@@ -39,12 +41,11 @@
         i += 2;
       }
       p = pool_new();
-      char hashbuf[41];
       //    log_debug(JDBG, "%s = '%s'", attrib[i], attrib[i+1]);
       shahash_r(spools(p, attrib[i + 1], pass, p), hashbuf);
 
       /* Build a handshake packet */
-      xmlnode cur = xmlnode_new_tag("handshake");
+      cur = xmlnode_new_tag("handshake");
       xmlnode_insert_cdata(cur, hashbuf, -1);
 
       /* Transmit handshake */
@@ -91,6 +92,7 @@
     if (jcr->current == NULL) {
       g_io_channel_close(jcr->gio);
     } else {
+      xmlnode parent;
       if (strncasecmp(name, "stream:error", 12) == 0) {
         log_warn(JDBG, "%s", xmlnode2str(jcr->current));
         g_io_channel_write_chars(jcr->gio, "xxxxxxx", 15, &bytes, NULL);
@@ -100,7 +102,7 @@
         break;
       }
 
-      xmlnode parent = xmlnode_get_parent(jcr->current);
+      parent = xmlnode_get_parent(jcr->current);
       if (parent == NULL) {
         x = xmlnode_dup(jcr->current);
         to = jid_new(x->p, xmlnode_get_attrib(x, "to"));
diff -ur jcr-0.1.2//src/main.c jcr-0.1.2-compiles//src/main.c
--- jcr-0.1.2//src/main.cSat Nov  1 17:27:21 2003
+++ jcr-0.1.2-compiles//src/main.cTue Feb 17 17:59:03 2004
@@ -34,11 +34,11 @@
   struct stat st;
   char *config_file = NULL;
   pool p;
-  jcr = (jcr_instance)malloc(sizeof(_jcr_instance));
 
   GThread       *dthread; /* the packet delivery thread */
   GMainLoop     *gmain;   /* the receive packet event loop */
 
+  jcr = (jcr_instance)malloc(sizeof(_jcr_instance));
 
   fprintf(stderr, "%s -- %s\n%s\n\n", _JCOMP_NAME, _JCOMP_VERS, _JCOMP_COPY);
 
@@ -119,6 +119,8 @@
 
 
   if (inBackground == 1) {
+    int fdlimit = 0, fd = 0;
+
     if ((pid = fork()) == -1) {
       fprintf(stderr, "%s: Could not start in background\n", JDBG);
       exit(1);
@@ -128,8 +130,7 @@
 
     /* in child process .... process and terminal housekeeping */
     setsid();
-    int fdlimit = sysconf(_SC_OPEN_MAX);
-    int fd = 0;
+    fdlimit = sysconf(_SC_OPEN_MAX);
     while (fd < fdlimit)
       close(fd++);
     open("/dev/null",O_RDWR);
Nástroje: Začni sledovat (0) ?Zašle upozornění na váš email při vložení nového komentáře.

Odpovědi

23.4.2004 09:29 Petr Šobáň | skóre: 80 | blog: soban | Olomouc
Rozbalit Rozbalit vše Re: jabber 2 & mu-conference - kompilace
Odpovědět | | Sbalit | Link | Blokovat | Admin
Jednoduše pokud máte správný patch pro správnou verzi tak ho použijete a program patch modifikuje ten soubor. A provádí se to programem patch :-) Více viz man patch :-)

PATCH(1)
NAME
patch - apply a diff file to an original

SYNOPSIS
patch [options] [originalfile [patchfile]]

but usually just

patch -pnum < patchfile
23.4.2004 10:06 zdenek-hbr | skóre: 10 | blog: .
Rozbalit Rozbalit vše Re: jabber 2 & mu-conference - kompilace
diky za radu, ale asi s tim neumim zachazet:
server-br:/home/zdenek# patch < patch
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur jcr-0.1.2//jcomp/jcr_elements.c jcr-0.1.2-compiles//jcomp/jcr_elements.c
|--- jcr-0.1.2//jcomp/jcr_elements.cTue Nov  4 22:42:42 2003
|+++ jcr-0.1.2-compiles//jcomp/jcr_elements.cThu Jan 29 17:56:50 2004
--------------------------
File to patch: jcr-0.1.2/jcomp/jcr_elements.c
patching file jcr-0.1.2/jcomp/jcr_elements.c
Hunk #1 FAILED at 32.
Hunk #2 FAILED at 41.
Hunk #3 FAILED at 92.
Hunk #4 FAILED at 102.
4 out of 4 hunks FAILED -- saving rejects to file jcr-0.1.2/jcomp/jcr_elements.c.rej
23.4.2004 10:29 Petr Šobáň | skóre: 80 | blog: soban | Olomouc
Rozbalit Rozbalit vše Re: jabber 2 & mu-conference - kompilace
can't find file to patch at input line 4 Perhaps you should have used the -p or --strip option?

Takže jseš v špatném adresáři, u špatného souboru a podobně + tě chybí parametr -p podle toho v jakém adresáři jseš. (-p0, -p1.....)

Viz man patch.

Prostě jednoduše ten program path nenašel ten soubor nebo nesedí ta cesta atd.....
23.4.2004 10:31 Zdeněk Štěpánek | skóre: 57 | blog: uz_mam_taky_blog | varnsdorf
Rozbalit Rozbalit vše Re: jabber 2 & mu-conference - kompilace
Odpovědět | | Sbalit | Link | Blokovat | Admin
Zdravim

Nakopiruj ten patch do slozky jcr-0.1.2 a uvnitr spust

patch -p1 < stazeny.patch

Zdenek
www.pirati.cz - s piráty do parlamentu i jinam www.gavanet.org - czfree varnsdorf
23.4.2004 10:46 zdenek-hbr | skóre: 10 | blog: .
Rozbalit Rozbalit vše Re: jabber 2 & mu-conference - kompilace
no tak uz mi to nepise tu chybu s -pnum, ale furt to nejde. zkousel jsem vsechny mozny kombinace. v ruznych adresarich ruzna -p, ale nic. verze toho patche je stejna, ale asi tam naky odlisnosti budou stejne ne? :(
server-br:/home/zdenek/jcr-0.1.2# patch -p1 < patch
patching file jcomp/jcr_elements.c
Hunk #1 FAILED at 32.
Hunk #2 FAILED at 41.
Hunk #3 FAILED at 92.
Hunk #4 FAILED at 102.
4 out of 4 hunks FAILED -- saving rejects to file jcomp/jcr_elements.c.rej
server-br:/home/zdenek/jcr-0.1.2#
23.4.2004 13:52 zdenek-hbr | skóre: 10 | blog: .
Rozbalit Rozbalit vše Re: jabber 2 & mu-conference - kompilace
Odpovědět | | Sbalit | Link | Blokovat | Admin
hmm. tak pro me jediny reseni bylo upravit to rucne :( ale uz to aspon slape :)

Založit nové vláknoNahoru

Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.