Activity 28.8.
Finally, link it all together and make an executable program:
gcc -o testComplex testComplex.o complexlib.o -lm
- Without the
-c
flag,gcc
creates an executable file. - The
-o
flag specifies the name of the output file "testComplex". - All of the object files that are to be linked together are listed.
- The
-lm
flag forces the inclusion of the mathematics library.
Running the executable program:
./testComplex
./
indicates that the executable is located in the current directory. This is how you typically run programs under Linux. On theengs20
servers you don’t have to type this part.
If the server window does not load, please click here.