user52421: I found a really nice 24 bit I2C adc which was fairly cheap as well (ADS1219) but as far as I could tell there are no libraries for it so I decided to make my own. I have managed to write functions and get everything working on the arduino itself but I've been having massive issues with converting it into a library.
So I tried a very basic sketch to see if I can do something as simple as printing hello world using the library.
Here is my ADS1219.h file:
#ifndef ADS1219
#define ADS1219

#if ARDUINO >= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif

class ADS1219{
public:
 ADS1219();
 void begin();
 void printHello();
};

#endif

And the ADS1219.cpp:
#if ARDUINO >= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif

#include 

ADS1219::ADS1219{
 Serial.println("New object created!");
}

void ADS1219::begin(){
 Serial.begin(9600);
}

void ADS1219::printHello(){
 Serial.println("Hello World");
}

and my main sketch:
#include 

ads = new ADS1219;

void setup() {
  Serial.begin(9600);
  ads.begin();
}

void loop() {
  ads.printHello();
  delay(2000);
}

but I get this really long error which basically says I've failed with creating the ads object.
I tried ADS1219 ads; as well but same error ... not sure what's wrong tbh.
Arduino: 1.8.8 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

In file included from sketchADS1219.cpp:7:0:

ADS1219.h:14:11: error: expected unqualified-id before ')' token

   ADS1219();

           ^

ADS1219.h:12:14: error: an anonymous struct cannot have function members

 class ADS1219{

              ^

ADS1219.h:18:1: error: abstract declarator '' used as declaration

 };

 ^

ADS1219.cpp:9:17: error: expected id-expression before '{' token

 ADS1219::ADS1219{

                 ^

ADS1219.cpp:13:21: error: explicit qualification in declaration of 'void begin()'

 void ADS1219::begin(){

                     ^

ADS1219.cpp:17:26: error: explicit qualification in declaration of 'void printHello()'

 void ADS1219::printHello(){

                          ^

In file included from C:UsersOM222ODesktopadslibadslib.ino:1:0:

ADS1219.h:14:11: error: expected unqualified-id before ')' token

   ADS1219();

           ^

ADS1219.h:12:14: error: an anonymous struct cannot have function members

 class ADS1219{

              ^

ADS1219.h:18:1: error: abstract declarator '' used as declaration

 };

 ^

adslib:3:1: error: 'ads' does not name a type

 ads = new ADS1219;

 ^

C:UsersOM222ODesktopadslibadslib.ino: In function 'void setup()':

adslib:7:3: error: 'ads' was not declared in this scope

   ads.begin();

   ^

C:UsersOM222ODesktopadslibadslib.ino: In function 'void loop()':

adslib:11:3: error: 'ads' was not declared in this scope

   ads.printHello();

   ^

exit status 1
expected unqualified-id before ')' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


user-1: Are you sure you're compiling this for C++ and not C?
In any case, you're defining 
#define ADS1219

I'm not sure what that does to your class name. Have you tried to
#define ADS1219_H  // <- Standard include guard

instead? Does this yield different results.

user4143: Your problem stems from this line:
#define ADS1219

You define the macro ADS1219 as empty. From that point on all references to ADS1219 get replaced with nothing. For example:
class ADS1219{
public:
 ADS1219();
 void begin();
 void printHello();
};

becomes:
class {
public:
 ();
 void begin();
 void printHello();
};

And
void ADS1219::begin(){
 Serial.begin(9600);
}

becomes:
void ::begin(){
 Serial.begin(9600);
}

By using the same name in your header guard as your class name you screw everything else up.
I always use strict rules for header guard macros to ensure that they never conflict with anything else.  You should change yours to read something else.  I would use:
#ifndef _ADS1219_H
#define _ADS1219_H

// ... content

#endif


You are also lacking the parenthesis in the constructor implementation:
ADS1219::ADS1219{
 Serial.println("New object created!");
}

should read:
ADS1219::ADS1219(){
 Serial.println("New object created!");
}

And you don't give your ads variable a type and you don't want to use new:
ads = new ADS1219;

should read:
ADS1219 ads;


52421: <p>I found a really nice 24 bit I2C adc which was fairly cheap as well (ADS1219) but as far as I could tell there are no libraries for it so I decided to make my own. I have managed to write functions and get everything working on the arduino itself but I've been having massive issues with converting it into a library.
So I tried a very basic sketch to see if I can do something as simple as printing hello world using the library.
Here is my ADS1219.h file:</p>

<pre><code>#ifndef ADS1219
#define ADS1219

#if ARDUINO &gt;= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif

class ADS1219{
public:
 ADS1219();
 void begin();
 void printHello();
};

#endif
</code></pre>

<p>And the ADS1219.cpp:</p>

<pre><code>#if ARDUINO &gt;= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif

#include 

ADS1219::ADS1219{
 Serial.println("New object created!");
}

void ADS1219::begin(){
 Serial.begin(9600);
}

void ADS1219::printHello(){
 Serial.println("Hello World");
}
</code></pre>

<p>and my main sketch:</p>

<pre><code>#include 

ads = new ADS1219;

void setup() {
  Serial.begin(9600);
  ads.begin();
}

void loop() {
  ads.printHello();
  delay(2000);
}
</code></pre>

<p>but I get this really long error which basically says I've failed with creating the ads object.
I tried ADS1219 ads; as well but same error ... not sure what's wrong tbh.</p>

<pre><code>Arduino: 1.8.8 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

In file included from sketchADS1219.cpp:7:0:

ADS1219.h:14:11: error: expected unqualified-id before ')' token

   ADS1219();

           ^

ADS1219.h:12:14: error: an anonymous struct cannot have function members

 class ADS1219{

              ^

ADS1219.h:18:1: error: abstract declarator '' used as declaration

 };

 ^

ADS1219.cpp:9:17: error: expected id-expression before '{' token

 ADS1219::ADS1219{

                 ^

ADS1219.cpp:13:21: error: explicit qualification in declaration of 'void begin()'

 void ADS1219::begin(){

                     ^

ADS1219.cpp:17:26: error: explicit qualification in declaration of 'void printHello()'

 void ADS1219::printHello(){

                          ^

In file included from C:UsersOM222ODesktopadslibadslib.ino:1:0:

ADS1219.h:14:11: error: expected unqualified-id before ')' token

   ADS1219();

           ^

ADS1219.h:12:14: error: an anonymous struct cannot have function members

 class ADS1219{

              ^

ADS1219.h:18:1: error: abstract declarator '' used as declaration

 };

 ^

adslib:3:1: error: 'ads' does not name a type

 ads = new ADS1219;

 ^

C:UsersOM222ODesktopadslibadslib.ino: In function 'void setup()':

adslib:7:3: error: 'ads' was not declared in this scope

   ads.begin();

   ^

C:UsersOM222ODesktopadslibadslib.ino: In function 'void loop()':

adslib:11:3: error: 'ads' was not declared in this scope

   ads.printHello();

   ^

exit status 1
expected unqualified-id before ')' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -&gt; Preferences.
</code></pre>
 -1: <p>Are you sure you're compiling this for C++ and not C?</p>

<p>In any case, you're defining </p>

<pre><code>#define ADS1219
</code></pre>

<p>I'm not sure what that does to your class name. Have you tried to</p>

<pre><code>#define ADS1219_H  // &lt;- Standard include guard
</code></pre>

<p>instead? Does this yield different results.</p>
 4143: <p>Your problem stems from this line:</p>

<pre><code>#define ADS1219
</code></pre>

<p>You define the macro ADS1219 as empty. From that point on all references to ADS1219 get replaced with nothing. For example:</p>

<pre><code>class ADS1219{
public:
 ADS1219();
 void begin();
 void printHello();
};
</code></pre>

<p>becomes:</p>

<pre><code>class {
public:
 ();
 void begin();
 void printHello();
};
</code></pre>

<p>And</p>

<pre><code>void ADS1219::begin(){
 Serial.begin(9600);
}
</code></pre>

<p>becomes:</p>

<pre><code>void ::begin(){
 Serial.begin(9600);
}
</code></pre>

<p>By using the same name in your header guard as your class name you screw everything else up.</p>

<p>I always use strict rules for header guard macros to ensure that they never conflict with anything else.  You should change yours to read something else.  I would use:</p>

<pre><code>#ifndef _ADS1219_H
#define _ADS1219_H

// ... content

#endif
</code></pre>

<hr>

<p>You are also lacking the parenthesis in the constructor implementation:</p>

<pre><code>ADS1219::ADS1219{
 Serial.println("New object created!");
}
</code></pre>

<p>should read:</p>

<pre><code>ADS1219::ADS1219(){
 Serial.println("New object created!");
}
</code></pre>

<p>And you don't give your <code>ads</code> variable a type and you don't want to use new:</p>

<pre><code>ads = new ADS1219;
</code></pre>

<p>should read:</p>

<pre><code>ADS1219 ads;
</code></pre>
