无法在 Netbeans 7.3 中运行程序

无法在 Netbeans 7.3 中运行程序

我最近安装了 Ubuntu 12.04,并在其上安装了 Netbeans 7.3(不是 Ubuntu 版本,直接从网站上安装)。我试图运行一个使用 Allegro 5 的基本 C++ 程序,但即使它可以编译,也无法运行。当项目位于不同的分区时,它给出的错误是:

/bin/sh: 1: exec: pathToProject/dist/Debug/GNU-Linux-x86/projectName: Permission denied

但是,当我将项目直接复制到我的主文件夹时,出现以下错误:

X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 13 Current serial number in output stream: 13

如果有帮助的话,这是程序:

#include <allegro5/allegro.h>

int main()
{
    al_init();
    ALLEGRO_DISPLAY *display = al_create_display (1000,1000);
    al_clear_to_color (al_map_rgb (255,255,255));
    al_flip_display ();
    al_rest(2);
}

答案1

glx-librariesUbuntu 中安装了吗?

关于mesa-glx-libraries

答案2

不,不要太快!您的代码片段中缺少 return 吗?或者它只是许多不同块中的一个块?

我错了 - 这与 glx-libraries 无关 - 但这稍微偏离主题,并且涉及使用 c++ 或 gnu 进行编程 - 您在 netbeans 中使用的是什么编译器?

allegro 作为头文件是 gnu 的 g++ 的一部分,但 g++ 是 netbeans 的一部分。

例如 gnu-compiler g++ 可以处理 allegro-header-file 但您需要在其终端中链接它。

http://www.daniweb.com/software-development/cpp/threads/68527/g-allegro-linking

正如我在这里读到的,allegro 目前与 netbeans 中的 g++“粘在一起” - 这里是关于...的完整论坛。

https://netbeans.org/ (在右上角输入搜索词“allegro”)

相关内容