gpt4 book ai didi

c++ - SDL 与 linux g++ 的链接错误

转载 作者:太空宇宙 更新时间:2023-11-04 04:49:22 25 4
gpt4 key购买 nike

Here is the error I get from my terminal when I try to compile the code

/*This is the init file that controls all the major background processes
will contain major bliting of backgrounds,surfaces, and handle collision
*/
#ifndef_init_H_
#define _init_H_

#include <SDL>



class init{
private:
bool Running;
SDL_Surface* Surf_Display;
public:
init();
int OnExecute();
public:
bool OnInit();
void OnEvent(SDL_Event* Event);
void OnLoop();
void OnRender();
void OnCleanup();
};

如果您想知道的话,这里是我几乎从 sdltutorials.com 复制的代码。我使用了他们的基本教程。我认为 sdl 和我的操作系统可能存在链接错误,但不确定。

最佳答案

列出了两个错误 - 您在第一个 #ifndef 之后需要一个空格,而且您的编译器似乎找不到 SDL 头文件 - 也许它们尚未安装,或者您需要 -Ipath/to/SDL/include 编译器选项,以便它看起来在正确的位置。

关于c++ - SDL 与 linux g++ 的链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10916880/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com