I must admit that I'm not very experienced with Ada. I'm working with an
interface since I need to be able to call a library written in Ada from
..NET. I made a small project and compiled it as follows:
gnatmake -c api
gnatbind -n api
gnatdll -d api.dll api.ali
Now, everything works fine. I'm able to call the library from a C# .NET
program. However, if I create a GPS project file an try to compile, I get
the following error:
i:\temp\adatest\adadll\obj\api.o:api.adb:(.text+0x38): undefined reference
to `adainit'
i:\temp\adatest\adadll\obj\api.o:api.adb:(.text+0x57): undefined reference
to `adafinal'
gnatmake: gcc execution error
Does anyone know what to do? The GPS project file look like this:
project Api is
for Library_Name use "api";
for Library_Dir use "dll";
for Library_Ali_Dir use "ali";
for Library_Kind use "dynamic";
for Languages use ("Ada");
for Object_Dir use "obj";
for Library_Interface use ("API");
for Library_Auto_Init use "False";
for Library_Src_Dir use "dll";
package Compiler is
for Default_Switches ("Ada") use ("-gnat95", "-gnatv", "-lgnat");
end Compiler;
package Linker is
for Linker_Options use ("-lgnat");
end Linker;
end Api;