#include <application.h>

Hello.

I am writing some libraries and doing so in separe files. When writing this files I get error messages that some pin symbols and other libraries are not present in the new ccp file…

#include <application.h> seems to solve my issues like including Arduino.h does in arduino SDK… BUT…

Is this the right way?
Is this like <Arduino.h> ??

And… Why the lower case in the name? (Just curious)

You need "" so #include "application.h"

Not sure why lower case but just to makenit simple I guess?

The #include is like what you use when your libraries need that

Got it. So application.h it is… with quotes “”.

I mentioned the lower case, because I think that there should be code guidelines somewhere for the entire ecosystem. Some of the most popular object oriented languages use the file names with title case (first letter in upper) to differentiate a Class from instances of the class (Those are usually in lowercase). I am only an enthusiast so I might be wrong… :slight_smile:

2 Likes

What do you say @zachary and @jgoggins? :slight_smile:

You are correctly using

#include "application.h"

We decided on all lowercase filenames. It just matched the prior experience of those of us creating :spark:. The tropicssl library we use in the core-communication-lib also uses lowercase file names. So do typical ruby projects and many JavaScript projects. It’s just one of those mostly arbitrary decisions you make when starting a software project. :slight_smile:

You may also be interested in checking out a change proposed this morning related to including application.h in libraries:

I am attempting to build a PWS (Personal Weather Station) to send date from the Sparkfun weather board and photon to Wunderground. The IDE app calls for application.h. Do I need to get this application.h and add it to one of the tabs and is there an application.cpp that must also have to be added? Does anyone have the programs to use the photon with the weather board to transmit data to wunderground?

@RobertVaughan, the web IDE will do the include for you in your main app as part of the pre-processing.

Which weather board are you referring to?

Here is the error I’m getting: _sparkfun_photon_weather_wunderground.cpp:48:52: fatal error: SparkFun_Photon_Weather_Shield_Library.h: No such file or directory
#include “application.h”

What dev environment are you using (Build, Dev, CLI, local toolchain)?

Could you also post the context (preceeding/following messages) of that error message?

Getting the same issue here, and haven't managed to find a solution yet.

Trying to compile this for Electron on Particle Dev and . If I use Particle Build, it works fine.

In general, Particle Dev gives limited info about compile errors. I get stuff like "build didn't produce binary Error: Command failed: /spark/compile..." But then click on error and it says "There were no compile errors". I saw some other threads about particle.ignore files, but doesn't seem to help.

Therefore I switched to Particle CLI on Mac. Get this error:

Matts-MBP:tsl2561 mattl$ particle compile electron tsl2561.ino

Compiling code for electron

Including:
tsl2561.ino
attempting to compile firmware
Compile failed. Exiting.
tsl2561.cpp:2:25: fatal error: SFE_TSL2561.h: No such file or directory
#include "application.h"

Copying and pasting code between Atom and build.particle.io to verify, compile, flash is getting painful.

Cheers

M

Libraries 2.0 will make things a lot easier for all of us :wink:

Currently you need to have the library files (but only these and none of the examples or other files containing void setup()/void loop()) in side your project folder and then you need to compile the project folder and not just the .ino file.

particle compile electron <projectFolder> --saveTo firmware.bin 

BTW, your line 2 (which is mentioned in the error message) looks like this:

#include "SFE_TSL2561.h"

which hasn’t got anything to with application.h really

Hi,
just came here, need help please.
where can find application.h ?
Best
Adam

It’s built into the Web IDE and is installed automatically if you are using particle workbench