I have upgraded to the latest version of Wheezy. (My gut feeling is that my problems may well be associated).
I made a copy of motor.c and named it motor_01.c
I made simple mods to the file motor_01.c and then to compile and link, ran:
gcc -o motor_01 motor_01.c and got errors.
I undid the mods to motor_01.c and ran gcc again and still got the errors even though it was now a direct copy of motor.c. Errors as below:
pi@raspberrypi ~/gertb/gertboard_sw $ gcc -o motor_01 motor_01.c
/tmp/ccd54CfW.o: In function `setup_gpio':
motor_01.c:(.text+0xa4): undefined reference to `gpio'
/tmp/ccd54CfW.o: In function `main':
motor_01.c:(.text+0xf8): undefined reference to `setup_io'
motor_01.c:(.text+0x118): undefined reference to `setup_pwm'
motor_01.c:(.text+0x140): undefined reference to `force_pwm0'
motor_01.c:(.text+0x154): undefined reference to `long_wait'
motor_01.c:(.text+0x15c): undefined reference to `set_pwm0'
motor_01.c:(.text+0x194): undefined reference to `long_wait'
motor_01.c:(.text+0x1a8): undefined reference to `long_wait'
motor_01.c:(.text+0x1b0): undefined reference to `set_pwm0'
motor_01.c:(.text+0x1e4): undefined reference to `pwm_off'
motor_01.c:(.text+0x204): undefined reference to `force_pwm0'
motor_01.c:(.text+0x224): undefined reference to `long_wait'
motor_01.c:(.text+0x22c): undefined reference to `set_pwm0'
motor_01.c:(.text+0x264): undefined reference to `long_wait'
motor_01.c:(.text+0x278): undefined reference to `long_wait'
motor_01.c:(.text+0x280): undefined reference to `set_pwm0'
motor_01.c:(.text+0x2c8): undefined reference to `pwm_off'
motor_01.c:(.text+0x2d4): undefined reference to `restore_io'
motor_01.c:(.text+0x300): undefined reference to `gpio'
collect2: ld returned 1 exit status
I'm sure I am doing something very stupid - but to date I have not been able to fathom what I'm doing wrong.
Any pointers would be gratefully received.