|
按照这个教程来的。
https://www.matsson.com/prog/sdl2-mingw-w64-tutorial.php
运行时提示
程序“main.exe”无法运行: 指定的可执行文件不是此操作系统平台的有效应用程序。所在位置 行:1 字符: 1
+ .\\main.exe
+ ~~~~~~~~~~~。
所在位置 行:1 字符: 1
+ .\\main.exe
+ ~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
我把程序精简一下:
#include <stdio.h>
#include <SDL2/SDL.h>
int main(int argc, char* argv[])
{
/* Initializes the timer, audio, video, joystick,
haptic, gamecontroller and events subsystems */
if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
printf("Error initializing SDL: %s\n", "Hello"); //SDL_GetError());
return 0;
}
printf("SDL successfully initialized!\n");
SDL_Quit();
return 0;
}
这样依然不行。
如果去掉SDL部分,程序是能正常执行的。可以printf打印出字符串。
|
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|