mccdaq / daqhats

MCC DAQ HAT Library for Raspberry Pi
Other
125 stars 88 forks source link

Unable to Compile/Run Data Logger Example #19

Closed WorldwideBrandt closed 4 years ago

WorldwideBrandt commented 4 years ago

I am unable to run this example when using the command window or Geany. When using Geany, I receive a number of errors like:

logger.c:103.5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode

I am able to run the continuous example though

nwright-mcc commented 4 years ago

Did you install all the prerequisites per the README.md in the example directory? What version of Raspbian are you using?

jeffreyg3 commented 4 years ago

I Googled the error, the search showed:

You need to add one of the suggested options to the compile command configured in geany,

In the menu.. Build -> Set Build Commands add "-std=c99" after "gcc" in Compile and Build boxes.

WorldwideBrandt commented 4 years ago

Did you install all the prerequisites per the README.md in the example directory? What version of Raspbian are you using?

I did follow the readme. I am running Version 8

WorldwideBrandt commented 4 years ago

I Googled the error, the search showed:

You need to add one of the suggested options to the compile command configured in geany,

In the menu.. Build -> Set Build Commands add "-std=c99" after "gcc" in Compile and Build boxes.

I also found this, but it did not seem to solve the issue for me.

WorldwideBrandt commented 4 years ago

When I attempt to run the example via the terminal I receive the error:

logger.c:103.5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode

However, when using Geany I receive the error:

usr/local/include/gtkdatabox_graph.h:37:21: fatal error: gdk/gdk.h: No such file or directory

include <gdk/gdk.h>

nwright-mcc commented 4 years ago

I tested building this example under Jessie (Raspbian version 8) and got the same errors. I modified logger.c so it would build on the older version of the C compiler, so can you go to your daqhats directory and run 'git pull' to download the latest code then try building it again? Make sure you run 'sudo apt update' before installing any packages with apt.

In geany, you would need to use the Build -> Make menu to build the example.