在我的系统上,运行以下使用clang或gcc编译的C ++代码片段
#include <cstdio>
#include <SDL2/SDL.h>
int main(int argc, char** args)
{
printf("Hi");
SDL_Init(SDL_INIT_VIDEO);
SDL_CreateWindow("", 0, 0, 800, 600, 0);
printf("Bye");
}
然后我在运行时得到以下输出
process 9360: arguments to dbus_connection_open_private() were incorrect, assertion "address != NULL" failed in file dbus-connection.c line 2664.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace
Hi
在尝试编译和运行已在另一台机器上运行的SDL2代码时,我遇到了同样的问题,尽管如果在该机器上编译它,则运行二进制文件会有效。
我正在运行Antergos Linux,应该使用最新版本的SDL2和D-Bus(我通过pacman定期运行更新)。我将非常感谢您的帮助,并乐意回答任何进一步的问题,谢谢。
答案 0 :(得分:0)
我安装SDL2时出现问题。我从源代码编译和安装,现在SDL2工作正常。