https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80594

            Bug ID: 80594
           Summary: error: ‘SDL_Window’ does not name a type
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nils.gramberg at gmx dot de
  Target Milestone: ---

Created attachment 41298
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41298&action=edit
precompiled header file

As a c++ programmer with 20+years of experience,
i am trying to compile a visual c++ project under linux.

i tried a testprogramm that included the SDL2/SDL.h library
and it worked. when i was compiling my code the compiler gave me the error
mentioned above.

i think i made no mistake so i am asking you to support me.

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 

command line: gcc aicontrol.cpp -fpermissive

here the dump of the console:

 gcc aicontrol.cpp -fpermissive
In file included from unit.h:6:0,
                 from mech.h:4,
                 from control.h:4,
                 from AIControl.h:6,
                 from aicontrol.cpp:1:
screen.h:19:2: error: ‘SDL_Window’ does not name a type
  SDL_Window* window;
  ^
In file included from mech.h:4:0,
                 from control.h:4,
                 from AIControl.h:6,
                 from aicontrol.cpp:1:
unit.h:266:1: warning: ‘typedef’ was ignored in this declaration
 };
 ^
In file included from control.h:4:0,
                 from AIControl.h:6,
                 from aicontrol.cpp:1:
mech.h:406:19: warning: non-static data member initializers only available with
-std=c++11 or -std=gnu++11
  bool critfirst = true;
                   ^
mech.h: In member function ‘void mech::initfromfile(std::__cxx11::string)’:
mech.h:78:34: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fscanff(f, "%s\n%s\n%s\n", name);
                                  ^
mech.h:79:34: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fscanff(f, "%s\n%s\n%s\n", name);
                                  ^
mech.h:80:21: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Mass:"); fscanf(f, "%i\n", &tons);
                     ^
mech.h:81:27: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Heat Sinks:"); fscanf(f, "%f\n", &heatsinks); heatsinks =
(int)he
                           ^
mech.h:83:24: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Walk MP:"); fscanf(f, "%f\n", &bpwalk); bpwalk = (int)bpwalk;
                        ^
mech.h:84:24: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Jump MP:"); fscanf(f, "%f\n", &bpjump); bpjump = (int)bpjump;
                        ^
mech.h:85:22: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Armor:");
                      ^
mech.h:88:23: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
    fsearch(f, "Armor:"); fscanf(f, "%i\n", &armor[t]);
                       ^
mech.h:90:25: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Left Arm:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n",
te
                         ^
mech.h:90:82: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 "Left Arm:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:91:26: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Right Arm:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n",
t
                          ^
mech.h:91:83: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 Right Arm:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:92:27: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Left Torso:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", 
                           ^
mech.h:92:84: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 eft Torso:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:93:28: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Right Torso:"); for (int t = 0; t < 12; t++) { fscanff(f,
"%s\n",
                            ^
mech.h:93:85: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 ght Torso:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:94:29: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Center Torso:"); for (int t = 0; t < 12; t++) { fscanff(f,
"%s\n"
                             ^
mech.h:94:86: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 ter Torso:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:95:21: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Head:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n",
text);
                     ^
mech.h:95:78: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 (f, "Head:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:96:25: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Left Leg:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n",
te
                         ^
mech.h:96:82: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 "Left Leg:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:97:26: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "Right Leg:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n",
t
                          ^
mech.h:97:83: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
 Right Leg:"); for (int t = 0; t < 12; t++) { fscanff(f, "%s\n", text);
componen
                                                                     ^
mech.h:102:19: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "HD:"); fscanf(f, "%i\n", &innerstructure[0]);
                   ^
mech.h:103:25: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "CT Torso:"); fscanf(f, "%i\n", &innerstructure[1]);
                         ^
mech.h:104:26: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "L/R Torso:"); fscanf(f, "%i\n", &innerstructure[2]);
innerstructu
                          ^
mech.h:105:24: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "L/R Arm:"); fscanf(f, "%i\n", &innerstructure[4]);
innerstructure
                        ^
mech.h:106:24: warning: deprecated conversion from string constant to ‘char*’
[-Wwrite-strings]
   fsearch(f, "L/R Leg:"); fscanf(f, "%i\n", &innerstructure[6]);
innerstructure
                        ^
In file included from AIControl.h:7:0,
                 from aicontrol.cpp:1:
input.h: In member function ‘void input::init()’:
input.h:20:37: error: ‘SDL_GetKeyboardState’ was not declared in this scope
   keyboard = SDL_GetKeyboardState(&d); printf("%i keys\n", d);
                                     ^
input.h: In member function ‘bool input::tick()’:
input.h:38:19: error: ‘SDL_MOUSEWHEEL’ was not declared in this scope
     if (e.type == SDL_MOUSEWHEEL) 
                   ^
input.h:40:15: error: ‘SDL_Event {aka union SDL_Event}’ has no member named
‘wheel’
      MSz += e.wheel.y*(e.wheel.direction == SDL_MOUSEWHEEL_NORMAL ? 1 : -1);
               ^
input.h:40:26: error: ‘SDL_Event {aka union SDL_Event}’ has no member named
‘wheel’
      MSz += e.wheel.y*(e.wheel.direction == SDL_MOUSEWHEEL_NORMAL ? 1 : -1);
                          ^
input.h:40:45: error: ‘SDL_MOUSEWHEEL_NORMAL’ was not declared in this scope
      MSz += e.wheel.y*(e.wheel.direction == SDL_MOUSEWHEEL_NORMAL ? 1 : -1);
                                             ^
input.h: In member function ‘bool input::isKey(char*)’:
input.h:66:3: error: ‘SDL_Scancode’ was not declared in this scope
   SDL_Scancode scan = SDL_GetScancodeFromName(key);
   ^
input.h:67:7: error: ‘scan’ was not declared in this scope
   if (scan == 0) { printf("unknown key %s\n", key);  return false; }
       ^
input.h:68:20: error: ‘scan’ was not declared in this scope
   return (keyboard[scan] != 0);
                    ^
input.h: In member function ‘bool input::isKeyOnce(char*)’:
input.h:74:41: error: ‘SDL_GetScancodeFromName’ was not declared in this scope
   int scan = SDL_GetScancodeFromName(key);
                                         ^
In file included from aicontrol.cpp:1:0:
AIControl.h: In member function ‘void aicontrol::setTorso(mech*)’:
AIControl.h:82:2: error: expected primary-expression before ‘/’ token
 */
  ^
AIControl.h:83:3: error: expected primary-expression before ‘}’ token
   }
   ^
In file included from aicontrol.cpp:1:0:
AIControl.h: In member function ‘vec2 aicontrol::lookaround(unit*)’:
AIControl.h:305:60: error: invalid initialization of non-const reference of
type ‘line&’ from an rvalue of type ‘line’
     if (a->theboard->themap_o->walk(line(pl[t], pl2[tt]), a) < maxwalk)
                                                            ^
In file included from nav.h:6:0,
                 from unit.h:5,
                 from mech.h:4,
                 from control.h:4,
                 from AIControl.h:6,
                 from aicontrol.cpp:1:
map.h:35:8: note:   initializing argument 1 of ‘float map::walk(line&, unit*)’
  float walk(line &b, unit* travfunc);
        ^
sundancer@sundancer-B85M-D2V /media/sundancer/Coding/_Source/RoboWar/!Source $
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-5 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--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 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

Reply via email to