Link to home
Create AccountLog in
Linux

Linux

--

Questions

--

Followers

Top Experts

Avatar of R6
R6

gcc error on feature.h: operator && has no right operand
hi experts, i came across a compiler error (gcc 4.0) while trying to install libbow (20020213 build, www.cs.cmu.edu/~mccallum/bow/).  This error is as following: "/usr/include/feature.h:265:41: error: operator '&&' has no right operand".  I've had a look at this feature.h file and have no idea how to fix this problem.  Please help me:)

thanks,

R6

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Infinity08Infinity08🇧🇪

I can't find feature.h in the bow library that you linked to ... what does it belong to ?

Can you show the line where the error occurred ?

Avatar of R6R6

ASKER

hi Infinity08,

thanks for helping me:)  well actually it is features.h (not feature.h) file comes with the linux distributiion under the /usr/include as it is on my system.  The gcc compiler complains the following directive:

#if _FORTIFY_SOURCE > 0 && __OPTIMIZE__ > 0 \  (specifically, this line, line265)
    && (__GNUC_PREREQ (4, 1) \
        || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
        || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
            && __GNUC_MINOR__ == 4 \
            && (__GNUC_PATCHLEVEL__ > 2 \
                || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))


Thanks:)

r6

Avatar of R6R6

ASKER

by the way, sorry about the missing 's' to the file name...lOl

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Infinity08Infinity08🇧🇪

what does __OPTIMIZE__ expand to ? And _FORTIFY_SOURCE ?

There might be a bug somewhere ... Did you recently upgrade your compiler ? What is your glibc version ?

Avatar of R6R6

ASKER

hi guru,

what does __OPTIMIZE__ expand
>> __OPTIMIZE__ is defined in the bow-20020213/argp/argp-fs-xinl.c file.  In this file it has these two lines," #undef __OPTIMIZE__" and "#define __OPTIMIZE__"..

And _FORTIFY_SOURCE ?
>> /* These are defined by the user (or the compiler)
   to specify the desired environment:

 _FORTIFY_SOURCE      If set to numeric value > 0 additional security
                  measures are defined, according to level.


Did you recently upgrade your compiler ? What is your glibc version ?
>> No, i didn't.  How do u check glibc version?


Sorry that's all i can provide u with.. hope this helps as im really lost..

thanks,

r6

ASKER CERTIFIED SOLUTION
Avatar of Infinity08Infinity08🇧🇪

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of R6R6

ASKER

hi guru,

i've followed yoru instruction and have all __OPTIMIZE__ replaced and it worked out fine:)  However, i now run into a new error.. which is:
svm_base.c: In function 'svm_parse_opt':
svm_base.c:265: error: label at end of compound statement

Again.. i have no idea what went wrong up here.. so please help me:)

thanks,

R6

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Infinity08Infinity08🇧🇪

>> svm_base.c:265: error: label at end of compound statement

I assume that you are using the same version as the one I'm looking at (20020213). Can you confirm that ?

Anyway, this is the code I have around that line :

    <SNIP>
        case 4:
          kernel = svm_kernel_fisher;
          break;
        default:                                       /* <--- this line */
        }
        break;
      case AL_TEST_IN_TRAIN_ARG:
    <SNIP>

The problem is that you have an empty label (default:) there. Make that :

    <SNIP>
        case 4:
          kernel = svm_kernel_fisher;
          break;
        default:
          break;                                       /* <--- add this line */
        }
        break;
      case AL_TEST_IN_TRAIN_ARG:
    <SNIP>

(without the <SNIP>'s of course :))

Avatar of R6R6

ASKER

>> I assume that you are using the same version as the one I'm looking at (20020213). Can you confirm that ?
that is correct sir:)

now i've fixed the default error.  But i still cant finish making it.. now the compiler complains about some undefined references to _option_is_short and _option_is_end.. im sorry to ask for you help once again..

./argp/libargp.a(argp-parse.o)(.text+0x2a3): In function `convert_options':
/home/server/bow-20020213/argp/argp-parse.c:348: undefined reference to `_option_is_short'
./argp/libargp.a(argp-parse.o)(.text+0x3b6):/home/server/bow-20020213/argp/argp-parse.c:339: undefined reference to `_option_is_end'
./argp/libargp.a(argp-parse.o)(.text+0x55b): In function `calc_sizes':
/home/server/bow-20020213/argp/argp-parse.c:478: undefined reference to `_option_is_end'
./argp/libargp.a(argp-help.o)(.text+0x308): In function `make_hol':
/home/server/bow-20020213/argp/argp-help.c:413: undefined reference to `_option_is_short'
./argp/libargp.a(argp-help.o)(.text+0x31d):/home/server/bow-20020213/argp/argp-help.c:409: undefined reference to `_option_is_end'
./argp/libargp.a(argp-help.o)(.text+0x3d8):/home/server/bow-20020213/argp/argp-help.c:441: undefined reference to `_option_is_short'
./argp/libargp.a(argp-help.o)(.text+0x411):/home/server/bow-20020213/argp/argp-help.c:446: undefined reference to `_option_is_end'
./argp/libargp.a(argp-help.o)(.text+0x42d):/home/server/bow-20020213/argp/argp-help.c:424: undefined reference to `_option_is_end'
./argp/libargp.a(argp-help.o)(.text+0x518): In function `hol_entry_first_short':
/home/server/bow-20020213/argp/argp-help.c:512: undefined reference to `_option_is_short'
./argp/libargp.a(argp-help.o)(.text+0x582): In function `until_short':
/home/server/bow-20020213/argp/argp-help.c:552: undefined reference to `_option_is_short'
./argp/libargp.a(argp-help.o)(.text+0xaef): In function `hol_append':
/home/server/bow-20020213/argp/argp-help.c:826: undefined reference to `_option_is_short'
./argp/libargp.a(argp-help.o)(.text+0xebd): In function `hol_entry_help':
/home/server/bow-20020213/argp/argp-help.c:1033: undefined reference to `_option_is_short'
./argp/libargp.a(argp-help.o)(.text+0x1068):/home/server/bow-20020213/argp/argp-help.c:1087: undefined reference to `_option_is_short'
./argp/libargp.a(argp-help.o)(.text+0x1404):/home/server/bow-20020213/argp/argp-help.c:512: more undefined references to `_option_is_short' follow
collect2: ld returned 1 exit status
make: *** [rainbow] Error 1

by the way, i've increased the point value of this question hoping to reflect the time u spend with this post..thats the least i can do:)

thanks,

r6

Avatar of Infinity08Infinity08🇧🇪

Mmm ... that's a bit less straightforward.

What operating system is this (exact version) ? Can you also run these commands to get the gcc and glibc versions :

        gcc --version
        ls -l /lib/libc*
        /lib/libc.so.6

and post the output here.


That should be in the argp-xinl.o object file. Can you do this :

        nm argp-xinl.o

to show the symbols in the object file, and post the output here.

Can you also show how you compiled this (the commands) ?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of R6R6

ASKER

>> What operating system is this (exact version) ?
FC4

>> gcc --version
gcc (GCC) 4.0.0 20050519 (Red Hat 4.0.0-8)

>> ls -l /lib/libc*
-rwxr-xr-x  1 root root 1489572 May 30  2005 /lib/libc-2.3.5.so
lrwxrwxrwx  1 root root      11 Feb 26  2006 /lib/libcap.so -> libcap.so.1
lrwxrwxrwx  1 root root      14 Feb 25  2006 /lib/libcap.so.1 -> libcap.so.1.10
-rwxr-xr-x  1 root root   11744 Mar  2  2005 /lib/libcap.so.1.10
-rwxr-xr-x  1 root root  191632 May 30  2005 /lib/libcidn-2.3.5.so
lrwxrwxrwx  1 root root      16 Feb 25  2006 /lib/libcidn.so.1 -> libcidn-2.3.5.so
lrwxrwxrwx  1 root root      17 Feb 25  2006 /lib/libcom_err.so.2 -> libcom_err.so.2.1
-rwxr-xr-x  1 root root    7836 May 10  2005 /lib/libcom_err.so.2.1
-rwxr-xr-x  1 root root   27660 May 30  2005 /lib/libcrypt-2.3.5.so
-rwxr-xr-x  1 root root 1111368 May 21  2005 /lib/libcrypto.so.0.9.7a
-rwxr-xr-x  1 root root 1089068 May 19  2005 /lib/libcrypto.so.0.9.7f
lrwxrwxrwx  1 root root      19 Feb 26  2006 /lib/libcrypto.so.4 -> libcrypto.so.0.9.7a
lrwxrwxrwx  1 root root      19 Feb 25  2006 /lib/libcrypto.so.5 -> libcrypto.so.0.9.7f
lrwxrwxrwx  1 root root      17 Feb 25  2006 /lib/libcrypt.so.1 -> libcrypt-2.3.5.so
lrwxrwxrwx  1 root root      13 Feb 25  2006 /lib/libc.so.6 -> libc-2.3.5.so

>> /lib/libc.so.6
GNU C Library development release version 2.3.5, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.0.0 20050525 (Red Hat 4.0.0-9).
Compiled on a Linux 2.4.20 system on 2005-05-30.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        Native POSIX Threads Library by Ulrich Drepper et al
        The C stubs add-on version 2.1.2.
        BIND-8.2.3-T5B
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        Glibc-2.0 compatibility add-on by Cristian Gafton
        GNU Libidn by Simon Josefsson
Thread-local storage support included.

>> nm argp-xinl.o
no such object file however, i have this: argp-fs-xinl.o

         U _argp_fmtstream_ensure
00000163 T argp_fmtstream_point
00000094 T argp_fmtstream_putc
00000052 T argp_fmtstream_puts
000000d6 T argp_fmtstream_set_lmargin
00000105 T argp_fmtstream_set_rmargin
00000134 T argp_fmtstream_set_wmargin
         U _argp_fmtstream_update
00000000 T argp_fmtstream_write
         U memcpy

>> Can you also show how you compiled this (the commands) ?
basically, i just follow the installation instruction, that is, "configure --prefix=/usr/local", make

thanks,

r6

Avatar of Infinity08Infinity08🇧🇪

>> no such object file however, i have this: argp-fs-xinl.o

That's odd ...

Can you show the output for this command :

        ls -al ./argp/*.o

when you're in the bow directory.

Did the configure command complete successfully ? Were there any compilation errors before the ones you showed ?

Avatar of R6R6

ASKER

>>  ls -al ./argp/*.o
-rw-rw-r--  1 server server  1548 May 30 22:29 ./argp/argp-ba.o
-rw-rw-r--  1 server server  9412 May 30 22:29 ./argp/argp-fmtstream.o
-rw-rw-r--  1 server server  7288 Jun  7 05:03 ./argp/argp-fs-xinl.o
-rw-rw-r--  1 server server 39812 Jun  7 05:03 ./argp/argp-help.o
-rw-rw-r--  1 server server  2944 Jun  7 05:03 ./argp/argp.o
-rw-rw-r--  1 server server 20760 Jun  7 05:03 ./argp/argp-parse.o
-rw-rw-r--  1 server server  4484 Jun  7 05:03 ./argp/argp-pvh.o
-rw-rw-r--  1 server server  1536 Jun  7 05:03 ./argp/argp-pv.o
-rw-rw-r--  1 server server  2956 Jun  7 05:03 ./argp/argp-xinl.o
-rw-rw-r--  1 server server  1668 Jun  7 05:03 ./argp/pin.o

>> Did the configure command complete successfully ?
yes:)

>> Were there any compilation errors before the ones you showed ?
well nope..beside a few warnings.. and u've helped me to fix those preceding errors in the previous posts

thanks,

R6



Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Infinity08Infinity08🇧🇪

>> -rw-rw-r--  1 server server  2956 Jun  7 05:03 ./argp/argp-xinl.o

Ah, there it is :)

Can you run the nm command on that one ...

Avatar of R6R6

ASKER

lOl im such a noob how could i miss that lOl

>> nm argp-xinl.o
it outputs nothing.

so what does that tell u?

thanks,

r6

Avatar of Infinity08Infinity08🇧🇪

>> it outputs nothing.

>> so what does that tell u?

Did you change the __OPTIMIZE__ to __OPTIMIZE_ARGP__ everywhere ? (in some files it had to be modified more than once). Especially in the argp.h and argp-xinl.c files.


Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Infinity08Infinity08🇧🇪

>> Did you change the __OPTIMIZE__ to __OPTIMIZE_ARGP__ everywhere ?

Use this command to verify (start from the bow directory) :

        cd argp
        more * | grep "__OPTIMIZE__"

It shouldn't have any output.

Avatar of R6R6

ASKER

yes it outputs nothing and i still got the same errors, the __option_is_short one..when i make from the bow-20020213 directory.

thanks,

R6

Avatar of Infinity08Infinity08🇧🇪

argp-xinl.o should export some symbols at least ...

Can you delete all the .o files, and run the make again ?

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of R6R6

ASKER

>> Can you delete all the .o files, and run the make again ?
still got the same error and nm argp-xinl.o still outputs nothing.

by the way, are u able to install this program on ur system, just wondering?

thanks,

r6

Avatar of Infinity08Infinity08🇧🇪

>> still got the same error and nm argp-xinl.o still outputs nothing.

And you didn't make any other modifications to the code than the ones listed in this thread ?


>> by the way, are u able to install this program on ur system, just wondering?

I didn't try as I currently have no access to a Linux system with gcc. I might be able to try later tonight.

Avatar of R6R6

ASKER

>> And you didn't make any other modifications to the code than the ones listed in this thread ?
thats right sir.

>> I didn't try as I currently have no access to a Linux system with gcc. I might be able to try later tonight.
guess we'll have to wait till you try that out:)

thanks,

r6

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of Infinity08Infinity08🇧🇪

>> guess we'll have to wait till you try that out:)

I tested it on a FreeBSD system (not exactly Linux but similar enough) with gcc 3.4.6

The argp library compiled fine (after replacing <malloc.h> with <stdlib.h>) :

        cd argp
        make

If you do just that (after deleting the .o files) - does that make a difference ?

Avatar of R6R6

ASKER

>> The argp library compiled fine (after replacing <malloc.h> with <stdlib.h>) :
> >      cd argp
>>        make

yes im able to get this done and libargp.a created in /usr/local/lib as the result.

but when i make at bow-20020213 directory, i still got the same error as before..

thanks,
r6

Avatar of R6R6

ASKER

guru, do u think i should try compiling it with an older version of gcc?

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Infinity08Infinity08🇧🇪

>> yes im able to get this done and libargp.a created in /usr/local/lib as the result.
>> but when i make at bow-20020213 directory, i still got the same error as before..

The errors you showed were for the argp library :

./argp/libargp.a(argp-parse.o)(.text+0x2a3): In function `convert_options':
/home/server/bow-20020213/argp/argp-parse.c:348: undefined reference to `_option_is_short'

So, which errors do you get now ?


>> guru, do u think i should try compiling it with an older version of gcc?

If you can do that, then that would be a nice test. Because the code dates from over 5 years ago.

You can also revert the changes that we did uptil now before you try, and put them back if needed.


Avatar of R6R6

ASKER

>>./argp/libargp.a(argp-parse.o)(.text+0x2a3): In function `convert_options':
/home/server/bow-20020213/argp/argp-parse.c:348: undefined reference to `_option_is_short'

So, which errors do you get now ?

yep im still getting these errors although i successfully make and make install in argp dir..


>> If you can do that, then that would be a nice test. Because the code dates from over 5 years ago.
>> You can also revert the changes that we did uptil now before you try, and put them back if needed.
lol now im having problem making gcc-3.0... god... end of the world to me hahaha any thoughts for the hopeless guy :)

thanks,

r6

Avatar of Infinity08Infinity08🇧🇪

>> yep im still getting these errors

That doesn't make a lot of sense, as those errors are in compiling the argp library ... and you already did that successfully.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Linux

Linux

--

Questions

--

Followers

Top Experts

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.