Errors Running C Code Libraries
The ADC-DAC Pi Zero is a 2 Channel ADC and 2 Channel DAC for the Raspberry Pi
09/02/2021
Posted by:
Andr22
However, I keep getting all sorts of various errors. I believe I am correct in compiling it by using -nostartfiles as the .c and .h files do not use the make function commonly found in C programs. This appears to work and creates a file called a.out, however I can't run it. If someone could explain to me clearly how to compile and execute this code I would be extremely grateful. I am a total beginner when it comes to this, I just need to run this code for a project I am working on. Thanks
09/02/2021
Posted by:
andrew
Can you try compiling the demo-adcread.c program in the same directory as the ABE_ADCDACPi.c file?
Use the command "gcc ABE_ADCDACPi.c demo-adcread.c -o demo-adcread" to create an executable file called demo-adcread
If the demo file compiles and runs then it is probably the -nostartfiles parameter that is causing the problems with your program.
09/02/2021
Posted by:
Andr22
Hello Can you try compiling the demo-adcread.c program in the same directory as the ABE_ADCDACPi.c file? Use the command "gcc ABE_ADCDACPi.c demo-adcread.c -o demo-adcread" to create an executable file called demo-adcread If the demo file compiles and runs then it is probably the -nostartfiles parameter that is causing the problems with your program.
After attempting this I get a huge list of errors saying "error: stray '\1' in the program" etc
09/02/2021
Posted by:
andrew
Can you try cloning a new copy of our GitHub repository onto your Raspberry Pi using the command below and see if that has the same issues?
git clone https://github.com/abelectronicsuk/ABElectronics_C_Libraries.git
09/02/2021
Posted by:
Andr22
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.