Go Down

Topic: "AP_Var has not been declared' (Read 1 time) previous topic - next topic

Vacanic

Hi, I'm having problems troubleshooting a program for my Ardupilot Mega. I've tried certain methods to overcome this problem but to no avail.


This it the error message I keep getting :

In file included from /AP_Compass_HIL.h:4,
                 from AP_Compass_HIL.cpp:12:
Compass.h:47: error: 'AP_Var' has not been declared
Compass.h:47: error: expected `)' before 'key'
Compass.h:125: error: 'AP_Var_group' does not name a type
Compass.h:126: error: ISO C++ forbids declaration of 'AP_VarS' with no type
Compass.h:126: error: expected ';' before '<' token
Compass.h:127: error: ISO C++ forbids declaration of 'AP_VarS' with no type
Compass.h:127: error: expected ';' before '<' token
Compass.h:128: error: 'AP_Float' does not name a type
In file included from AP_Compass_HIL.cpp:12:
AP_Compass_HIL.h:8: error: 'AP_Var' has not been declared
AP_Compass_HIL.h:8: error: expected `)' before 'key'



Does anyone know of a way to correct this problem?

PaulS

All the messages refer to the same file which you did not post or even provide a link to.

Quote
Does anyone know of a way to correct this problem?

Yes. But it requires that you share more information.

Vacanic

These are the two files I have problems with.

Is there anything else that I can provide you with?

PaulS

Quote
Is there anything else that I can provide you with?

Yes. Either all the files in the library and sketch folder, or a link to the library.

I am having the same issue with this file that i downloaded and have not changed i have jsut tryed to compile it to make sure i have all the necessary libraries and ended up with this error after commenting (out the packet.param5 ==1)if statement in the GCS_Mavlink tab ihttps://code.google.com/p/arducopter/downloads/detail?name=ArduCopter-2.9.1-rc1.zip&can=2&q= off the arducopter code page, i an new at arduino i have a little experience in processing, with generative design but nothing on this level.

UKHeliBob

What we need is a sketch that recreates problem code based solely on the error messages received or a mindreader() function
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

PaulS

Quote
based solely on the error messages received

Solely on "a snippet of", you mean.

UKHeliBob

Based solely on the thread subject would be even better.  We could test it on this one http://arduino.cc/forum/index.php/topic,145824.0.html
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up