Linking program with .a libraries
I am busy porting some old c code from IBM AIX to Linux. It's the first time I use Linux so I guess I am an absolute newbie .
The code is compiled with -c -g and then the .o files are stored by module in a module.a library (ar rcv). The main() function is also located in one of the module.a libraries.
The compilation works fine (same script as with AIX), but when I use the link command:
cc module1.a module2.a .... modulen.a -o myprogram
then it complains about undefined references in functions of module1.a using e.g. functions of module2.a. Declairing the function as external in module1.a and recompile does not help.
The same command under IBM AIX works perfect and links the program without complaining.
Is there a compiler or linker option I should use?