LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Failing to compile c file (https://www.linuxquestions.org/questions/linux-software-2/failing-to-compile-c-file-872910/)

Roboam León López 04-04-2011 12:12 PM

Failing to compile c file
 
Hello everyone, i trying to compile courier-imap-3.0.8 (no te latest version but that's a requirement) using gcc 4.4.5 (Debian 5) I ran:
Quote:

./configure --enable-unicode=iso-8859-1,utf-8
And went Ok with the verification, but when ran
Quote:

make
I got:
Code:

Compiling checkpassword.c
checkpassword.c: In function ‘authcheckpassword’:
checkpassword.c:66: warning: value computed is not used
checkpassword.c:69: warning: value computed is not used
checkpassword.c:71: warning: value computed is not used
Compiling cryptpassword.c
Compiling authstaticlistsearch.c
In file included from authstaticlistsearch.c:9:
/usr/include/stdio.h:397: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&&’ token
authstaticlistsearch.c: In function ‘authstaticlist_search_string’:
authstaticlistsearch.c:138: warning: value computed is not used
authstaticlistsearch.c: In function ‘authlogin_search_string’:
authstaticlistsearch.c:169: warning: value computed is not used
authstaticlistsearch.c:180: warning: value computed is not used
authstaticlistsearch.c:188: warning: value computed is not used
authstaticlistsearch.c:191: warning: value computed is not used
authstaticlistsearch.c:193: warning: value computed is not used
authstaticlistsearch.c:224: warning: value computed is not used
authstaticlistsearch.c:235: warning: value computed is not used
authstaticlistsearch.c:241: warning: value computed is not used
authstaticlistsearch.c:243: warning: value computed is not used
authstaticlistsearch.c:247: warning: value computed is not used
authstaticlistsearch.c:251: warning: value computed is not used
make[2]: *** [authstaticlistsearch.o] Error 1
make[2]: se sale del directorio `/home/user/courier-imap-3.0.8/authlib'
make[1]: *** [all] Error 2
make[1]: se sale del directorio `/home/user/courier-imap-3.0.8/authlib'
make: *** [all-recursive] Error 1

Compiling courier-imap-3.0.8/authlib/authstaticlistsearch.c manually (gcc -o authstaticlistsearch authlib/authstaticlistsearch.c ) made similar error:
Code:

In file included from authlib/authstaticlistsearch.c:9:
/usr/include/stdio.h:397: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘&&’ token
authlib/authstaticlistsearch.c:23: error: ‘AUTHCHANGEPASS’ undeclared here (not in a function)
authlib/authstaticlistsearch.c: In function ‘openconfigfile’:
authlib/authstaticlistsearch.c:30: error: ‘O_RDONLY’ undeclared (first use in this function)
authlib/authstaticlistsearch.c:30: error: (Each undeclared identifier is reported only once
authlib/authstaticlistsearch.c:30: error: for each function it appears in.)

I could replicate the error in another debian (debian 5 or 6) box.

How should I proceed? I' clueless. My stdio.h it's OK and not corrupted
How do I get more information? google didn't help much.

My /usr/include/stdio.h:

Code:

387 #ifdef __USE_XOPEN2K8
388 /* Write formatted output to a file descriptor.
389
390    These functions are not part of POSIX and therefore no official
391    cancellation point.  But due to similarity with an POSIX interface
392    or due to the implementation they are cancellation points and
393    therefore not marked with __THROW.  */
394 extern int vdprintf (int __fd, __const char *__restrict __fmt,
395                      _G_va_list __arg)
396      __attribute__ ((__format__ (__printf__, 2, 0)));
397 extern int dprintf (int __fd, __const char *__restrict __fmt, ...)
398      __attribute__ ((__format__ (__printf__, 2, 3)));
399 #endif


johnsfine 04-04-2011 12:34 PM

My first guess would be something included before stdio.h defined a macro that conflicts with some non macro declaration in stdio.h

I forget exact gcc options, but you can get the preprocessed intermediate step saved to a file and find the problem line in that file and see what if anything macro expansion did to that line.

More generally, compiling old open source projects in newer versions of gcc is often harder than it is worth. I understand you don't want to use a newer version of the original source code. What about using an older version of gcc? If installed correctly, an older version of gcc can be tied together with all its associated include files and co exist on your machine with the default version. You can set an environment variable to select the older version before running make on the old source code.

knudfl 04-04-2011 04:38 PM

No solution, so far. These are my notes ...

A package, i386 :
http://archive.debian.org/debian-arc...arge5_i386.deb
> courier-imap_3.0.8-4sarge5_i386.deb

Building courier-imap-3.0.8 :
cd courier-imap-3.0.8/ && zcat courier_0.47-4sarge5.diff.gz | patch -p1
http://archive.debian.org/debian-arc...sarge5.diff.gz

export CC=gcc-3.3 && ./configure && make :

Compiling authstaticlistsearch.c
In file included from authstaticlistsearch.c:9:
/usr/include/stdio.h:397: error: syntaksfejl before '&&' token
make[2]: *** [authstaticlistsearch.o] Error 1

Roboam León López 04-06-2011 12:51 PM

Wasn't able to compile the file with gcc 4.* so I use
Code:

apt-get install courier-imap courier-imap-ssl courier-authlib-ldap courier-webadmin
And its working with version 4.9

Thanks all for your help


All times are GMT -5. The time now is 01:08 PM.