Quantcast
Viewing all articles
Browse latest Browse all 22072

Bash script error "undefined reference to sin" [duplicate]

I am writing a bash script with the purpose of creating a static library for C code and creating an executable. The C program itself works fine, the problem I'm having is that when I run my current script I get the following readout in terminal.

This script will create Lab3 executable and static library..//liblab3.a(sin.o): In function `funcSin':sin.c:(.text+0x13): undefined reference to `sin'collect2: error: ld returned 1 exit statusEnd of script

I am very new to bash so I am at a loss.

This is my current script.

#!/bin/bashecho "This script will create Lab3 executable and static library."#create object filesgcc -c lab3main.c -o lab3main.ogcc -c sin.c -o sin.ogcc -c sphere.c -o sphere.ogcc -c sumFloats.c -o sumFloats.ogcc -c volCylinder.c -o volCylinder.o#create static libraryar rcs liblab3.a lab3main.o sin.o sphere.o sumFloats.o volCylinder.o#statically link & create executablegcc lab3main.o -L./ -llab3 -o lab3staticecho "End of script"

Viewing all articles
Browse latest Browse all 22072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>