Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


#3 Build of 3.48 fails (Arch Linux, x86_64)

Stefan Husmann

make[2]: Entering directory `/home/haawda/paketierung/maintained_by_me/wp2latex/src/wp2latex.348/sources.cc'
g++ -march=x86-64 -mtune=generic -O2 -pipe -O2 -I./atoms/include/ -I./cp_lib/ -DFINAL -fno-rtti -fno-exceptions -DERROR_HANDLER -c atoms/std_str.cc -o atoms/std_str.o -D__gettext__
atoms/std_str.cc: In function 'char* StrChr(const char*, int)':
atoms/std_str.cc:34: error: invalid conversion from 'const char*' to 'char*'
atoms/std_str.cc: In function 'char* StrStr(const char*, const char*)':
atoms/std_str.cc:62: error: invalid conversion from 'const char*' to 'char*'
make[2]: *** [atoms/std_str.o] Error 1
make[2]: Leaving directory `/home/haawda/paketierung/maintained_by_me/wp2latex/src/wp2latex.348/sources.cc'
make[1]: *** [TG_WP] Error 2
make[1]: Leaving directory `/home/haawda/paketierung/maintained_by_me/wp2latex/src/wp2latex.348/sources.cc'
make: *** [wp2latex] Error 2
==> ERROR: Build Failed.


  • Stefan Husmann
    Stefan Husmann

    Th following patch solves the problem

    diff -aur wp2latex.348.orig/sources.cc/atoms/std_str.cc wp2latex.348.new/sources.cc/atoms/std_str.cc
    --- wp2latex.348.orig/sources.cc/atoms/std_str.cc 2009-08-08 00:01:47.000000000 +0200
    +++ wp2latex.348.new/sources.cc/atoms/std_str.cc 2009-08-08 00:05:57.000000000 +0200
    @@ -30,7 +30,7 @@
    char *StrChr(const char *s, int c)


    if(s==NULL) return(NULL);


    + return(strchr((char *)s,c));



    @@ -58,7 +58,7 @@
    char *StrStr(const char *str1,const char *str2)


    if((str1==NULL)||(str2==NULL)) return(NULL);

    - return(strstr(str1,str2));

    + return(strstr((char *)str1,(char *)str2));



  • Are you sure that you run a "configure" script?

    If so, please include here a file

    The __Strict_Const_Procs should be defined here.

    • priority: 5 --> 2
  • But anyway, your patch is exactly what I do not wish to do:

    When __Strict_Const_Procs is on, then you have couple of StrStr functions. One for const argument and a second for non const argument.

    #ifdef __Strict_Const_Procs
    const char *StrStr(const char *str1,const char *str2);
    char *StrStr(char *str1,const char *str2);
    char *StrStr(const char *str1,const char *str2);

  • Stefan Husmann
    Stefan Husmann

    Yes, I did a configure step.

    Adding common.h seems to solve the problem. Can you readd it in upcoming versions of wp2latex?

  • Stefan Husmann
    Stefan Husmann

    Oops, I was too quick. It did not solve it. Same errot as before.

  • Your patch is completelly irelevant. It breaks all advantages of using "const char *".
    I hate to typecast from cost to not const, it might introduce unexpected problems.

    Again, did you run ".configure" script?

    Everything works fine on many architectures.

  • Stefan Husmann
    Stefan Husmann

    And again yes, I did a configure step, as I wrote two years ago.

    But I do not bother about a two years old problem. It is gone in 3.56 and 3.57.

    • status: open --> closed-out-of-date