Oxygen Basic
Information => Open Forum => Topic started by: JRS on September 02, 2013, 08:38:11 AM
-
(http://files.allbasic.info/O2/o2ice.png)
Cool program. (literally) You need to send this to Antarctica as they need a some help.
-
Charles,
I'm getting the following error(s) trying to compile your Exam1.c example.
jrs@laptop:~/B4A/xfer/O2/CLessons$ gcc Exam1.c -o Exam1
/tmp/ccNKDx5v.o: In function `ShowHWaves':
Exam1.c:(.text+0x40d): undefined reference to `sin'
Exam1.c:(.text+0x431): undefined reference to `sin'
/tmp/ccNKDx5v.o: In function `ShowVWaves':
Exam1.c:(.text+0x57a): undefined reference to `sin'
Exam1.c:(.text+0x5a1): undefined reference to `sin'
/tmp/ccNKDx5v.o: In function `ShowVWaves2':
Exam1.c:(.text+0x757): undefined reference to `sin'
collect2: ld returned 1 exit status
jrs@laptop:~/B4A/xfer/O2/CLessons$
Here are the results of trying to compile Exam2.c.
jrs@laptop:~/B4A/xfer/O2/CLessons$ gcc Exam2.c -o Exam2
Exam2.c: In function ‘q14’:
Exam2.c:28:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[8]’ [-Wformat]
/tmp/ccTEqgnz.o: In function `Qxxx':
Exam2.c:(.text+0x39f): undefined reference to `pow'
collect2: ld returned 1 exit status
jrs@laptop:~/B4A/xfer/O2/CLessons$
My error!
I forgot to add -lm to my gcc command line.
Exam2.c still has the following warning. BTW: If you enter a letter instead of a number, the program goes into an endless loop.
jrs@laptop:~/B4A/xfer/O2/CLessons$ gcc Exam2.c -lm -o Exam2
Exam2.c: In function ‘q14’:
Exam2.c:28:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[8]’ [-Wformat]
jrs@laptop:~/B4A/xfer/O2/CLessons$
-
I wouldn't bother with those 'Exam..' examples. They were workouts with Harri who I was tutoring for a university exam. He was working in Objective-C on an Apple, while I was working in GCC on the PC, answering various questions on C programming.
-
Okay, I understand. I'll treat this as a folder of Charles's PowerSnippets. 8)