0
votes

So we downloaded Ada Web Server, GNAT Studio, and put them in appropriate directories. We are not sure what is wrong, we have tried multiple tutorials. Specifically this one would not work Installation issue with AWS for Ada

We could not compile gnatmake -P hello.gpr When that is run it puts out

gcc -x -c  ada hello.gpr
hello.gpr:1:06: identifier expected
hello.gpr:2:01: compilation unit expected

This is our compilation error message. We have changed the prefix in the makefile.conf from AWS to the right directory, C:\GNAT\2016

Here is the tutorial we mainly tried to use, this site wont let me post our other resources. http://www.adacore.com/adaanswers/gems/gem-29/

Please let me know what it takes to get a hello_world working! Is there a better guide for windows 10 GNAT/AWS 2016?

Edit:

the zlib.gpr has errors and it is exactly what I downloaded from libre.adacore.com.

c:\GNAT\2016\Workspace\aws>gprbuild hello.gpr
zlib.gpr:19:06: unknown project file: "../../.build/projects/aws_config"
zlib.gpr:19:06: imported by "C:\GNAT\2016\Workspace\aws\include\zlib\zlib.gpr"
zlib.gpr:19:06: imported by "C:\GNAT\2016\Workspace\aws\aws.gpr"
zlib.gpr:19:06: imported by "C:\GNAT\2016\Workspace\aws\hello.gpr"
zlib.gpr:41:10: warning: no when others for this case construction
zlib.gpr:41:15: unknown package or project "Aws_Config"
zlib.gpr:41:15: variable "zlib_exists" is not a single string
gprbuild: "hello.gpr" processing failed
2
What's in the file "hello.gpr"? It might be a good idea to use gprbuild instead of gnatmake as a build manager. Are you sure you actually included the "-P" on the command line? - Jacob Sparre Andersen
I have updated my answer referred to so it recommends gprbuild. - Simon Wright

2 Answers

2
votes

You don't compile a project file via gcc. Gcc expects a source file. Instead, a .gpr file is passed to gprbuild, which then takes care of spawning compiler, binder and linker to create executables...

2
votes

I’m pretty sure you have used

gnatmake -p hello.gpr

instead of

gnatmake -P hello.gpr

-P file means "use the project file file", -p means "create any missing directories".

And, as others have said, it’s better to use gprbuild rather than gnatmake (I’ve updated the answer you referred to).