[SDL] SDL2 (latest hg, as of this morning) error in my application

Alex Barry alex.barry at gmail.com
Fri Mar 15 09:17:30 PDT 2013


I'm running LUbuntu, here is my output from `g++ -v`

$ g++ -v
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
> Target: x86_64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
> 4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
> --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
> --program-suffix=-4.7 --enable-shared --enable-linker-build-id
> --with-system-zlib --libexecdir=/usr/lib --without-included-gettext
> --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
> --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
> --enable-libstdcxx-debug --enable-libstdcxx-time=yes
> --enable-gnu-unique-object --enable-plugin --enable-objc-gc
> --disable-werror --with-arch-32=i686 --with-tune=generic
> --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
> --target=x86_64-linux-gnu
> Thread model: posix
> gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)


When I build my application, I get the following error:

In file included from /usr/local/include/SDL2/SDL_main.h:25:0,
>                  from /usr/local/include/SDL2/SDL.h:66,
>                  from sdlapp.hpp:2,
>                  from sdlapp.cpp:2:
> /usr/local/include/SDL2/SDL_stdinc.h: In function ‘char*
> SDL_strchr_inline(const char*, int)’:
> /usr/local/include/SDL2/SDL_stdinc.h:515:88: error: invalid conversion
> from ‘const char*’ to ‘char*’ [-fpermissive]
> /usr/local/include/SDL2/SDL_stdinc.h: In function ‘char*
> SDL_strrchr_inline(const char*, int)’:
> /usr/local/include/SDL2/SDL_stdinc.h:524:90: error: invalid conversion
> from ‘const char*’ to ‘char*’ [-fpermissive]
> /usr/local/include/SDL2/SDL_stdinc.h: In function ‘char*
> SDL_strstr_inline(const char*, const char*)’:
> /usr/local/include/SDL2/SDL_stdinc.h:533:116: error: invalid conversion
> from ‘const char*’ to ‘char*’ [-fpermissive]


Here is my build command:

g++ -g  main.cpp sdlapp.cpp -lSDL2 -lSDL2main -o main


Did I do something silly, or was this something that is actually an error?

I built SDL2 by doing the following:

hg clone http://hg.libsdl.org/SDL SDL2
> cd SDL2
> ./autoconf
> mkdir build
> cd build
> ../configure
> make
> sudo make install


 Everything built as expected, no notable errors or warnings.

Any ideas?
-Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20130315/bdebbd4c/attachment-0008.htm>


More information about the SDL mailing list