From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35ce1c7836290812,start X-Google-Attributes: gid103376,public From: colvert@ro.com (Paul Colvert) Subject: SGI GNAT Question? (Long) Date: 1999/03/02 Message-ID: <7bflkk$78i$1@news.ro.com>#1/1 X-Deja-AN: 450221190 X-Authenticated: colvert on POP host sh1.ro.com. Organization: Renaissance Internet Services Reply-To: colvert@ro.com Newsgroups: comp.lang.ada Date: 1999-03-02T00:00:00+00:00 List-Id: Greetings All! I have something of a mystery happening when using the GNAT Ada compiler (GNAT 3.11p) on a SGI Onyx. I was hoping that someone out there could enlighten me with this issue. I am sorry if this letter is somewhat long, but it was the best that I could do. Thanks. I have a simulation written in Ada95 that I am trying to build. My source code directory looks something like this: src/ ....common/ ...........common_files.ads ...........common_files.adb ....models/ ...........model_1/ ...................model_1.ads ...................model_1.adb ...........model_2/ ...................model_2.ads ...................model_2.adb ...........model_3/ ...................model_3.ads ...................model_3.adb ....linklib/ ............main_program_1.adb ............main_program_2.adb After successfully compiling the "common" source directory using this command: gcc -c -g -O0 -n32 /the.absolute.path/filename and each of the "models" source directories using this command: gcc -c -g -O0 -n32 -I/src/common /the.absolute.path/filename I successfully compile two different "mains" in the "linklib" source directory using this command: gcc -c -g -O0 -n32 \ -I/src/common \ -I/src/models/model_1 \ -I/src/models/model_2 \ -I/src/models/model_3 \ /the.absolute.path/filename At this point, I was able to bind and link the first "main" using the following commands: gnatbind -A -n32 \ -I/src/common \ -I/src/models/model_1 \ -I/src/models/model_2 \ -I/src/models/model_3 \ -I/src/linklib \ main_program_1.ali gnatlink -A -n32 -o main_program_1 main_program_1.ali But when I try to do the same thing with the second "main" using the same commands, the gnatlink command errors out saying that it could not find the file "common_files.ads". This appeared to be some kind of path problem. After some man page reading, I defined two environment variables, ADA_INCLUDE_PATH and ADA_OBJECTS_PATH, as this: ADA_INCLUDE_PATH=\ /src/linklib:\ /src/models/model_1:\ /src/models/model_2:\ /src/models/model_3:\ /src/common ADA_OBJECTS_PATH=\ /src/linklib:\ /src/models/model_1:\ /src/models/model_2:\ /src/models/model_3:\ /src/common Now, I am able to successfully bind and link both programs using the following commands: gnatbind -A -n32 main_program_1.ali gnatlink -A -n32 -o main_program_1 main_program_1.ali and gnatbind -A -n32 main_program_2.ali gnatlink -A -n32 -o main_program_2 main_program_2.ali Can anyone tell me why first method would work for one "main" but not the other? I know I can use the environment variable method, but I am really puzzled about the first method. Any help that could be offered would be greatly appreciated. Thanks! P.S. For those who may not know, the "-n32" option is a SGI specific ABI (Application Binary Interface). -- Paul Colvert colvert@ro.com