'SDL_INIT'在此范围内未声明

问题描述 投票:0回答:1

此:

#include <iostream>
#define SDL_MAIN_HANDLED
#include <SDL2/SDL.h>

int main(int argc, char ** argv)
{
  if (SDL_INIT( SDL_INIT_EVERYTHING ) < 0 )
  {
      std::cout << " error starting SDL " <<SDL_GetError( ) << std::endl;
  }
  return EXIT_SUCCESS;
}

返回:

||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
C:\Development\Projects\test\main.cpp||In function 'int main(int, char**)':|
C:\Development\Projects\test\main.cpp|7|error: 'SDL_INIT' was not declared in this scope|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

看到此:undefined reference to SDL_Init,并将我的SDL2版本更改为32位,该错误仍然出现。对此很陌生,因此如果这是一个愚蠢的问题,我们深表歉意。

c++ sdl-2
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.