Go Down

Topic: DallasTemperature does not name a type error (Read 1 time) previous topic - next topic

ScottG

I am using the Xcode IDE with my Arduino.  I don't have a problem compiling sketches that use onewire protocal in the Arduino IDE, but in Xcode, I'm getting this error:
DallasTemperature does not name a type
Below is a simple sketch that causes the error and I attached the libraries.  I can't figure out why Xcode gives me this error.  Can anyone help.

Code: [Select]
#include "Arduino.h"
#include <OneWire.h>
#include <DallasTemperature.h>
OneWire oneWire(2);
DallasTemperature waterTempSensors(&oneWire);  // Get error here
void setup() {}
void loop() {}

ScottG

I found the problem.  My library folder name needs to match the library name.  I had my library like this:
\Arduino\libraries\OneWireDallasTemp\DallasTemperature.h
\Arduino\libraries\OneWireDallasTemp\DallasTemperature.cpp

I renamed the folder \OneWireDallasTemp\ to \DallasTemperature\ and now it compiles.  I guess the Arduino IDE doesn't care about the directory name but Xcode does.


Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview