Hello all,
I cannot figure out how to add an object file to GPS. I assume the object file will be an O file (file.o). I prefer to do this using the IDE (not the command line), if possible. It seems this should be easy, but I’ve already gone to:
Project Properties → Library → Linker options (I tried to add file.o over there)
I even tried the same thing with a LIB file, and it still didn’t work.
Is there a totally different approach I need to take to get this working? Any help or suggestions would be greatly appreciated.
First of all, edit gpr file manually. It is easy, the language is similar to Ada.
Then, normally, you never need to link object files. Gprbuild understands many languages. So if you have a C source, simply add it to your project. To the project file add this:
for Languages use ("Ada", "C");
Then add your C source file[s]. You are done.
If you still need for some obscure reason link an object file, I think Linker_Options is correct. Just check that the full path to the file is correct:
package Linker is
for Linker_Options use ("file.o");
end Linker;