Object files not properly added to archive on mac
I am trying to build an archive from a collection of object files. I am doing this with ar -rs my_archive.a foo.o bar.o other_object_files.o . On a linux machine everything is fine but when I try the very same command on my mac it seems like only some object files are added. This results in undefined symbols corresponding to subroutines in, let's say, other_object_files.o . Moreover, if I try to manually link the object files that gave rise to undefined symbols, I can properly build the executable. That is ifort -o my_exec main.o other_object_files.o my_archive.a works fine. Am I missing some