我正在尝试从 Linux( Fedora 29 )交叉编译一个以 Windows 为目标的 Ada 程序。我对编译一无所知,Gnat 项目经理文档也无法帮助我这个菜鸟。我更喜欢在项目文件中使用开关,并使命令尽可能简单。我该怎么办?
我试过gprbuild -P logfilter.gpr --target=Windows
这导致
Error: no compiler found for language 'c', target = Windows, default runtime
Error: no compiler found for language 'ada', target = Windows, default runtime
logfilter.gpr:3:09: warning: no compiler specified for language "Ada", ignoring all its sources
logfilter.gpr:7:19: "log_filter_main.adb" is not a source of project "logfilter"
gprbuild: problems with main sources
这是我的gprconfig
:
prconfig has found the following compilers on your PATH.
Only those matching the target and the selected compilers are displayed.
1. GNAT for Ada in /usr/bin/ version 8.3 (default runtime)
2. GCC-ASM for Asm in /usr/bin/ version 8.3.1
3. GCC-ASM for Asm2 in /usr/bin/ version 8.3.1
4. GCC-ASM for Asm_Cpp in /usr/bin/ version 8.3.1
5. LLVM for C in /usr/bin/ version 7.0.1
6. GCC for C in /usr/bin/ version 8.3.1
7. G++ for C++ in /usr/bin/ version 8.3.1
我的gprconfig --show-targets
:
List of targets supported by a compiler:
x86_64-redhat-linux
x86_64-unknown-linux-gnu
这是我的file.gpr
:
with "../../lib/gnat/gtkada";
project LogFilter is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Exec_Dir use "exec";
for Main use ("log_filter_main.adb");
package Builder is
for Executable ("main.adb") use "Logs_Filter";
end Builder;
package Compiler is
for Switches ("ada") use ("-gnat2012");
end Compiler;
end Logfilter;