2015-06-22 62 views
0

我正在尝试使用GNAT 95编译我的计算机上运行CENTOS 7 64位与GNAT-GPL 2015 bundle的程序。我得到的是这样的一个编译器消息:Ada封装库项目GNAT

gprbuild: encapsulated library projects not supported on this platform 

我GPR文件看起来像这样:

with "bc.gpr"; -- Pull in the booch95 components since ada95 doesnt have collections 
with "mylibrary.gpr"; -- one of my library projects 

library project Registry is 
    for Source_Dirs use ("src/**"); 
    for Object_Dir use "bin"; 

    for Library_Name use "registry"; 
    for Library_Standalone use "encapsulated"; 
    for Library_ALI_Dir use "lib/registry"; 
    for Library_Dir use "plugins"; 
    for Library_Kind use "dynamic"; 
    for Library_Interfaces use ("..."); 

    package Compiler is 
     for Default_Switches ("Ada") use ("-g", "-gnat95"); 
    end Compiler; 

    package Linker is 
     for Linker_Options use ("-ldl", "-lgcov"); 
    end Linker; 
end project; 

了Booch组件库是一个静态库项目。卸下包裹原因阿达抛出另一个错误有关试图混合静态和动态库:

shared library project "registry" cannot import static library project "bc" 

任何想法可能会导致Ada的编译器将崩溃?

+0

注册表库必须是动态的吗?使用'Library_Kind使用“static”会发生什么情况;'? –

回答

2

除非您使用的是非常老版本的BC,你可以通过场景变化LIBRARY_TYPE设置为relocatable建设作为共享文件或动态库;通过设置为环境变量,或者通过设置为环境变量,或者通过设置为环境变量,或者通过设置为环境变量,或者使用GPS。我不是GPS用户,但是调查过它似乎(在GPS GPL 2014中),您在左侧的选项卡中选择场景,该选项卡应该显示项目中的场景变量以及它所依赖的项目(bc在你的情况)。选择一个你想改变的并点击钢笔图标,你会看到一个对话框来更新它。

Setting a scenario variable in GPS

+0

如何将-XLIBRARY_TYPE = relocatable参数添加到使用GPS的gnatmake命令中? – mikeyGlitz

+0

增加了一个设置'with'ed项目中定义的场景变量的示例。 –

+0

我没有意识到GPS中有一个场景选项卡。 – mikeyGlitz