gcc - Problem running c code on ubuntu - Ask Ubuntu


i have downloaded zip file of c programs website https://www1.maths.leeds.ac.uk/~wally.gilks/adaptive.rejection/web_page/welcome.html

i have extracted zip file , tried run c program arms_main01.c in ubuntu terminal, program throwing error in linking other files. how can run file ubuntu terminal?

the directory contains:

arms01a.m  arms02.m  arms.doc  arms_main01a.c  arms_main02.c  arms.nouniform.c  arms01.m   arms.c    arms.h    arms_main01.c   arms.method 

compile using gcc
open terminal inside directory , type:

gcc -c arms_main01.c -o arms_main01.o gcc -c arms.c -o arms.o gcc -o arms01 arms_main01.o arms.o -lm -lc 

running program
executable file created called: arms01 , run as:

./arms01 

output result
program created output file called: arms.out01, see content:

cat arms.out01 

done.


by way, directory contain 3 main programs:

arms_main01.c, arms_main01a.c, arms_main02.c 

in example above, compile , run: arms_main01.c

please see:

arms01.m, arms01a.m, arms02.m 

to know how compile , run programs according example above.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User