Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ada Environment Variable Path Issue

When compiling Ada, when I change the build path to the GNAT build, all global commands (clear, sudo, gcc, etc.) don't work but when I change it to the global (default) command, the global commands work, but the Ada build isn't recognized.

How do I fix this?

Note: ➜ Ada = $, (using Oh My Zzh from Ada folder)

Terminal: (Note start & end are the same)

➜  Ada gcc -c main.adb                        
error: invalid value 'ada' in '-x ada'
➜  Ada PATH=/Users/Ryan/opt/GNAT/2020/bin     
➜  Ada gcc -c main.adb                   
xcode-select: error trying to exec 'xcode-select': execvp: No such file or directory
gcc: error trying to exec 'as': execvp: No such file or directory
➜  Ada PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH
➜  Ada gcc -c main.adb                          
error: invalid value 'ada' in '-x ada'
➜  Ada 
like image 559
Ryan Cocuzzo Avatar asked May 16 '26 19:05

Ryan Cocuzzo


1 Answers

Just do

PATH=/Users/Ryan/opt/GNAT/2020/bin:${PATH}

instead of

PATH=/Users/Ryan/opt/GNAT/2020/bin

You need to preppend path to GNAT, not replace whole PATH.

like image 60
Maxim Reznik Avatar answered May 18 '26 08:05

Maxim Reznik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!