使用glib.h在GPS(Ada IDE)中进行编译的问题 [英] Troubles compiling in GPS (Ada IDE) with glib.h

查看:94
本文介绍了使用glib.h在GPS(Ada IDE)中进行编译的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在GPS中编译Ada代码时遇到了一些麻烦。当我将其包含在包装中时,GPS提示丢失。我尝试使用apt-get安装,但确实如此,但错误仍然存​​在。接下来我该怎么办?我在x64 Ubuntu 12.04上运行GPS。

i'm having some troubles when trying to compile Ada code in GPS. GPS says is missing when I include it on a package. I tried installing with apt-get, and it does, but the error is still there. What can I do next? I'm running GPS on a x64 Ubuntu 12.04.

这是我收到的错误消息:

Here's the error message I got:


gprbuild -d -P/media/LUISMUNYOZ/QUINTO/str/pendulum/pendulum_portatil/pendulum.gpr
 -XEXTRA=True -XOPENGL=True -XGNOME=True -XBUILD=Production
 print_barrier_sync.adb contrib.gpr:1:09: warning: no compiler specified for language "Xml",
 ignoring all its sources x86_64-pc-linux-gnu-gcc -c lw.c In file included from
 /media/LUISMUNYOZ/QUINTO/str/pendulum/pendulum_portatil/gtkada/testgtk/opengl/lw.c:20:0:
 /media/LUISMUNYOZ/QUINTO/str/pendulum/pendulum_portatil/gtkada/testgtk/opengl/lw.h:23:18:
 fatal error: glib.h: No such file or directory compilation terminated.
 gprbuild:* compilation phase failed

[2012-11-21 13:24:47] process exited with status 4 (elapsed time: 02.06s) [2012-11-21 13:24:56]
    Could not locate executable on path: svn SVN error:
[…]

错误此时触发:

#ifndef LW_H
#define LW_H

#include <glib.h>           <------------------------------------------
#include <GL/gl.h>

#define LW_MAX_POINTS   200
#define LW_MAX_NAME_LEN 500

The文件是lw.h,在软件包GtkAda中定义。我是从GPS页面下载的。

The file is lw.h, which is defined in the package GtkAda. I downloaded it from GPS page.

推荐答案

我会追求@Simon的方法,但基于 2.4.2。在解决基本问题时,使用命令行 可能是临时的选择。

I'd pursue @Simon's approach, but a work-around based on 2.4.2. Using the command line might be a temporary alternative while you sort out the underlying problem.

在使用linux时,这是 Makefile 用于基本的 Interaction 演示。

As you are using linux, here's a Makefile for the basic Interaction demo.

# Make shared, static or debug targets.
OS := $(shell uname)
OBJ = obj
TARGET = interaction
GNATMAKE = gnatmake -D $(OBJ)
CARGS = -cargs -O3 -gnatp -gnatwu -gnatf
BARGS = -bargs
LARGS = -largs
.PHONEY: clean cleaner cleanest

all:
    @echo ""
    @echo "Build targets:"
    @echo ""
    @echo "    shared     Use the shared Ada libraries."
    @echo "    static     Link the Ada libraries statically."
    @echo "    debug      Enable debugging."
    @echo ""
    @echo "Support targets:"
    @echo ""
    @echo "    clean      Remove *.ali *.o b~.*"
    @echo "    cleaner    Remove target, too."
    @echo "    cleanest   Remove build directory, too."
    @echo ""

shared: $(OBJ)
shared: INCLUDE = $(shell gtkada-config --cflags)
shared: BARGS += -shared
shared: LARGS += $(shell gtkada-config --libs)
shared: LARGS += -dead_strip
shared: *.ad[sb]
    @echo "building with shared libraries:"
    $(GNATMAKE) $(TARGET) $(INCLUDE) $(CARGS) $(BARGS) $(LARGS)

static: $(OBJ)
static: INCLUDE = $(shell gtkada-config --static --cflags)
static: BARGS += -static
static: LARGS += $(shell gtkada-config --static --libs)
static: LARGS += -dead_strip
static: *.ad[sb]
    $(GNATMAKE) $(TARGET) $(INCLUDE) $(CARGS) $(BARGS) $(LARGS)

debug: $(OBJ)
debug: INCLUDE = $(shell gtkada-config --static --cflags)
debug: BARGS += -static
debug: LARGS += $(shell gtkada-config --static --libs)
debug: *.ad[sb]
    $(GNATMAKE) -g $(TARGET) $(INCLUDE) $(LARGS)

$(OBJ):
    mkdir $(OBJ)

clean:
    ${RM} $(OBJ)/* b~*

cleaner: clean
    ${RM} $(TARGET)

cleanest: cleaner
    ${RM} -r $(OBJ) 

作为参考,这些软件包安装在Ubuntu 12.04上:

For reference, these packages were installed on Ubuntu 12.04:


$ dpkg --get-selections | egrep "gnat|gtkada"
gnat                        install
gnat-4.6                    install
gnat-4.6-base               install
gnat-gps                    install
gnat-gps-common             install
gnat-gps-doc                install
libgnat-4.6                 install
libgnatprj4.6               install
libgnatvsn4.6               install
libgtkada-bin               install
libgtkada2.24.1             install
libgtkada2.24.1-dev         install

这篇关于使用glib.h在GPS(Ada IDE)中进行编译的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆