#25 c/c++ extern conflict issues on Mandriva 2007.1

open
nobody
None
5
2007-06-22
2007-06-22
Simon Blandford
No

Compiling svn rev 72 on Mandriva 2007.1 I encountered the some "previous declaration of ‘char* optarg’ with ‘C++’ linkage"/"conflicts with new declaration with ‘C’ linkage" type errors.

I (perhaps naively, I'm not an expert in this) commented out one of the conflicting declarations until I got it to compile and successfully ran the program on a test page.

The compiler is gcc-4.1.2-1mdv2007.1.

The changes I made were,

in cutil/globals.h...
//extern int optind; /*option index */
//extern char *optarg; /*option argument */

in ccmain/tfacep.h...
// extern int display_ratings;

in ccmain/control.cpp...
//extern "C" { extern int display_ratings; }

Discussion

  • Wildhair
    Wildhair
    2007-11-12

    Logged In: YES
    user_id=1935799
    Originator: NO

    Using this information, it compiles on Suse 10.3, but fails to convert the phototest.tif

     
  • Logged In: NO

    I use Fedora 8. Tried the same. Commented out and compiled it successfully. But tesseract doesn't recognize the phototest.tif !