Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#include <problems...>
02-05-2013, 11:27 PM, (This post was last modified: 03-05-2013, 01:56 PM by Victor.)
#1
#include <problems...>
Hi to all !!!
Long silence from my side, but sometimes RL it's a bit hard...

So, I switched from X2 to X4 [really impressing, good job IDEboys Smile] but when compiling my old projects I got this complaining message:
Quote:Scheda: Pinguino 2550
Proc: 18f2550
File: C:\Pinguino\examples\test vittorio\rotore\rotor_1.pde
error while compiling
check highlighted lines in your code

Tweaking the source I found that the "offending" line is the #include <math.h>:
Code:
/* INCLUDES  */
#include <math.h>

/* VARIABLES */
float deg;
int delta_position;

/* DEFINES   */
/* PIC I/O pins using Pinguino pin numbering */
#define rotor_on_off 0
#define rotor_cw_ccw 1
#define rotor_speed 2
#define led1 10
#define led2 11
#define switch_1 12

void setup() {
  // S1=RC0=pin10   S2=RC1=pin11   PRG=RC2=pin12
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  // pin0=motor on/off   pin1=motor CW/CCW
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  // pin13=preset        pin14=rotor_pot
  pinMode(12,INPUT);
  pinMode(13, INPUT);
  pinMode(14, INPUT);

}

void loop()
{
  // put your main code here, to run repeatedly:
}

If I change the line using absolute path in #include <"c:\Pinguino\p8\include\math.h"> all's ok...

... what's wrong ???

Tnx in advance fro any suggestion, I'm sure that I'm a little nOOb Rolleyes

UPDATES:
version in use : Pinguino-X4-EasyPack-Win32-Rev685mod-v01-2013-02 into XP sp3
adding the right path to enviroment variables doesn't change anything...
Reply
09-05-2013, 08:37 AM,
#2
RE: #include <problems...>
Hi Victor,
You don't have to include libraries (except your own ones), the IDE should do it for you.
Try without #include <math.h> ...


(02-05-2013, 11:27 PM)Victor Wrote: Hi to all !!!
Long silence from my side, but sometimes RL it's a bit hard...

So, I switched from X2 to X4 [really impressing, good job IDEboys Smile] but when compiling my old projects I got this complaining message:
Quote:Scheda: Pinguino 2550
Proc: 18f2550
File: C:\Pinguino\examples\test vittorio\rotore\rotor_1.pde
error while compiling
check highlighted lines in your code

Tweaking the source I found that the "offending" line is the #include <math.h>:
Code:
/* INCLUDES  */
#include <math.h>

/* VARIABLES */
float deg;
int delta_position;

/* DEFINES   */
/* PIC I/O pins using Pinguino pin numbering */
#define rotor_on_off 0
#define rotor_cw_ccw 1
#define rotor_speed 2
#define led1 10
#define led2 11
#define switch_1 12

void setup() {
  // S1=RC0=pin10   S2=RC1=pin11   PRG=RC2=pin12
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  // pin0=motor on/off   pin1=motor CW/CCW
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  // pin13=preset        pin14=rotor_pot
  pinMode(12,INPUT);
  pinMode(13, INPUT);
  pinMode(14, INPUT);

}

void loop()
{
  // put your main code here, to run repeatedly:
}

If I change the line using absolute path in #include <"c:\Pinguino\p8\include\math.h"> all's ok...

... what's wrong ???

Tnx in advance fro any suggestion, I'm sure that I'm a little nOOb Rolleyes

UPDATES:
version in use : Pinguino-X4-EasyPack-Win32-Rev685mod-v01-2013-02 into XP sp3
adding the right path to enviroment variables doesn't change anything...
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
09-05-2013, 12:17 PM,
#3
RE: #include <problems...>
(09-05-2013, 08:37 AM)regis Wrote: Hi Victor,
You don't have to include libraries (except your own ones), the IDE should do it for you.
Try without #include <math.h> ...
Done! It works ... tnx for answer Regis!
I've done all without math.h, it's a good exercise for my mind Big GrinBig Grin

I'll publish my last work with Pinguino into Exhibition section in the next few day [I hope].

Tnx again, ciao Wink
Reply
09-05-2013, 12:31 PM,
#4
RE: #include <problems...>
Very odd. All the <...> headers protected themselves from being included multiple times, with reputable non-broken compilers.

John
Reply
19-07-2013, 12:28 AM, (This post was last modified: 19-07-2013, 12:45 AM by RobertoB.)
#5
RE: #include <problems...>
Hello Regis,

Here I am again, chasing that Pure Data project, good advance so far. Now I can't seem to be able to #include "my_file.h", which is allocated in the same folder where my .pde is.

I also tried what Victor did here of the absolute path, but no luck. I also put the header file in the "include" folder, added the #include instruction in the code, and took it off. No luck still.

Any word on this? what am I doing wrong?

Thanks very much!

(09-05-2013, 08:37 AM)regis Wrote: Hi Victor,
You don't have to include libraries (except your own ones), the IDE should do it for you.
Try without #include <math.h> ...


(02-05-2013, 11:27 PM)Victor Wrote: Hi to all !!!
Long silence from my side, but sometimes RL it's a bit hard...

So, I switched from X2 to X4 [really impressing, good job IDEboys Smile] but when compiling my old projects I got this complaining message:
Quote:Scheda: Pinguino 2550
Proc: 18f2550
File: C:\Pinguino\examples\test vittorio\rotore\rotor_1.pde
error while compiling
check highlighted lines in your code

Tweaking the source I found that the "offending" line is the #include <math.h>:
Code:
/* INCLUDES  */
#include <math.h>

/* VARIABLES */
float deg;
int delta_position;

/* DEFINES   */
/* PIC I/O pins using Pinguino pin numbering */
#define rotor_on_off 0
#define rotor_cw_ccw 1
#define rotor_speed 2
#define led1 10
#define led2 11
#define switch_1 12

void setup() {
  // S1=RC0=pin10   S2=RC1=pin11   PRG=RC2=pin12
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  // pin0=motor on/off   pin1=motor CW/CCW
  pinMode(0, OUTPUT);
  pinMode(1, OUTPUT);
  // pin13=preset        pin14=rotor_pot
  pinMode(12,INPUT);
  pinMode(13, INPUT);
  pinMode(14, INPUT);

}

void loop()
{
  // put your main code here, to run repeatedly:
}

If I change the line using absolute path in #include <"c:\Pinguino\p8\include\math.h"> all's ok...

... what's wrong ???

Tnx in advance fro any suggestion, I'm sure that I'm a little nOOb Rolleyes

UPDATES:
version in use : Pinguino-X4-EasyPack-Win32-Rev685mod-v01-2013-02 into XP sp3
adding the right path to enviroment variables doesn't change anything...

Hi again,

Never mind my question, I found that I had a bad header file, I was not defining its name in the file. I am kind of still exploring the language, so I have this fails. However, I also found header files that do not define their own name, in a working project. I wonder, I think there must be more to it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)