Trying to compile code for openhardwareexg continuous sampling error on Linux

Trying to compile code for openhardwareexg continuous sampling error on Linux Ubuntu Arduino due.
Did not check on Windows 10 yet. Changed added #include <Arduino.h> to get past first error I read that useualy that issue was on Linux. So could the error be it also?

Here is where I got the code from github under Arduino.

shown here
http://forum.arduino.cc/index.php?topic=116803.0

Now I get one more error... little more complex I wonder if it is the ads1298 file and the chip and then definition of the ads1299?

Arduino: 1.8.3 (Linux), Board: "Arduino Due (Programming Port)"

In file included from sketch/ADS129x.cpp:14:0:

ADS129x.h:6: error: redefinition of 'class ADS129xChip'
class ADS129xChip{
^
In file included from sketch/ADS129x.cpp:5:0:

ADS129x.h:6: error: previous definition of 'class ADS129xChip'
class ADS129xChip{
^
sketch/ADS129x.cpp: In constructor 'ADS129xChip::ADS129xChip()':
ADS129x.cpp:26: error: 'lastSample' was not declared in this scope
lastSample = NULL;
^
ADS129x.cpp:27: error: 'gain' was not declared in this scope

gain = NULL;
^
sketch/ADS129x.cpp: In destructor 'ADS129xChip::~ADS129xChip()':
ADS129x.cpp:32: error: 'lastSample' was not declared in this scope
delete[] lastSample;
^
ADS129x.cpp:

googled arduino size_t it told me to add to the ccp file
#include <Arduino.h> //added for size_t error

shown here
http://forum.arduino.cc/index.php?topic=116803.0

Now I get one more error... little more complex I wonder if it is the ads1298 file and the chip and then definition of the ads1299?


Arduino: 1.8.3 (Linux), Board: "Arduino Due (Programming Port)"

In file included from sketch/ADS129x.cpp:14:0:

ADS129x.h:6: error: redefinition of 'class ADS129xChip'
class ADS129xChip{
      ^
In file included from sketch/ADS129x.cpp:5:0:

ADS129x.h:6: error: previous definition of 'class ADS129xChip'
class ADS129xChip{
      ^
sketch/ADS129x.cpp: In constructor 'ADS129xChip::ADS129xChip()':
ADS129x.cpp:26: error: 'lastSample' was not declared in this scope
 lastSample = NULL;
 ^
ADS129x.cpp:27: error: 'gain' was not declared in this scope

 gain = NULL;
 ^
sketch/ADS129x.cpp: In destructor 'ADS129xChip::~ADS129xChip()':
ADS129x.cpp:32: error: 'lastSample' was not declared in this scope
 delete[] lastSample;
          ^
ADS129x.cpp:

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. If your browser doesn't show the posting toolbar then you can just manually add the code tags:
[code]`` [color=blue]// your code is here[/color] ``[/code]
Using code tags and other important information is explained in the How to use this forum post. Please read it.

What is this ADS129x stuff? Is it a library or example code you found somewhere? If so, post a link to where you found it. Please use the chain links icon on the toolbar to make links clickable. Is it some code you wrote? If so, then post the code.

Thanks do you think I could improve what I have more some how?

I can't reproduce the issue but I suspect it's caused by the lack of an include guard in the file ADS129x.h. Try this:

  • Open ADS129x.h in a text editor.
  • Add the following lines to the very top of the file:
#ifndef ADS129X_H
#define ADS129X_H
  • Add the following line to the very bottom of the file:
#endif /* ADS129X_H */
  • Save the file

So are you running Windows so you can't reproduce the error I herd it happens in Linux where the #include <Arduino.h> is needed. So maybe I just need it in Windows for now.?

I tried your suggestion in Linux Ubuntu same redefinition of class....

Yes, I'm using Windows but you're misinterpreting that forum thread. What they're talking about is that Windows is filename case insensitive so you can do something dumb like this:

#include <arduino.h>

and it still works even though the correct filename is Arduino.h. Linux is case sensitive so you actually need to get the filename right. If you use the right filename it works on Windows and Linux.

Please provide a minimal, complete and exact set of steps to reproduce the error including:

  • Version of the library you're using
  • Modifications made to the library
  • Sketch you're compiling