Closed GoogleCodeExporter closed 8 years ago
the build log shows that avr-g++ attempted to compile your library
have you checked what actual compilation errors were given (Errors and Warnings
tab
within the Output window)?
can you provide a link to this library?
Original comment by frank.zhao.main@gmail.com
on 4 Oct 2009 at 11:18
problem solved
actually found the library using google
i see the errors, NUM_TLCS and TLC_CHANNEL_TYPE are not declared
they are really not declared, i think in your code, you are supposed to specify
which
one of two configuration files you wish to use, one of either tlc_config.h or
default_tlc_config.h
if you added the library in Arduino's environment, it included both
tlc_config.h and
default_tlc_config.h on the top of your file, to get it working in my
environment, add
#include "default_tlc_config.h"
to the top of the file, it has to go BEFORE "#include "Tlc5940.h"
you've also pointed out another issue for me, there was a regular expression in
my
error and warning display routine that caused an error to be hidden, also i
made a
mistake in the template xml i provided, both issues will be fixed in the next
update
Original comment by frank.zhao.main@gmail.com
on 4 Oct 2009 at 11:45
go into configuration and remove the liba.a library, it was my mistake to
include
that in the templates.xml
also delete the templates.xml so the updated one can be restored
Original comment by frank.zhao.main@gmail.com
on 5 Oct 2009 at 12:14
[deleted comment]
The answer was swift and understandable :0)
Yet although i define my sketch now with
/*
Includes
*/
#include "Arduino_Mega.h"
#include "chip_includes.h"
#include "tlc_config.h"
#include "Tlc5940.h"
at the beginning it fails, with the same errors, to build.
It may sound a bit selfish if i ask that, but let me explain ;0)
Wouldnt it be possible to treat libraries the way the Arduino IDE does?
The reason for that is that many libraries i know work on the smae principles
and
hence this error would randomly occur, and that again and again as people, like
me,
wouldnt be able to include libs the way it is needed and include them the way
they
are used to ;0)
I know this is a big deal of work, but as templates already assign an Arduino
'type'
to the project you could also fake the according define and hence let the
compiler
select the right headers for the library at hand. How much deeper the needed
modifications to the make project go i dont know, but i think it is all in all
doable
and would spare you a great deal of 'errors' here..
Original comment by mamage...@gmail.com
on 5 Oct 2009 at 7:20
after i added the #include "tlc_config.h" and removed liba.a from the
configuration,
it compiled fine, and the latest update I've uploaded fixed the bug that may
have
hidden the error from you.
what arduino does is look into the folder for all the .h files in the library's
folder, and just include all of them, I disagree with this method because of
exactly
how some of these libraries are designed
what is arduino_mega.h? what is chip_includes.h?
also, selecting the right headers based on the selected chip is not something
that is
supposed to be done by an editor environment because it's already something
designed
into avr-gcc, you can write header files that checks for the chip you are
compiling
for by using
#ifdef __AVR_ATmega1280__
// code that only applies to arduino megas
#else
// code that never applies to arduino megas
#endif
inside the library, the "__AVR_ATmega1280__" is automatically defined by the
compiler, so in a sense, my editor has already done that for you when you apply
the
template
this is way better than having separate header files, instead, you just have one
header file and organize it with the above pre-processor statements
Original comment by frank.zhao.main@gmail.com
on 5 Oct 2009 at 3:18
arduino doesn't treat libraries in a special way at all, but it does scan for
the
ones you use so it knows which ones to compile. the only thing is that arduino
has a
button that lets the user automatically add in all the header files. all you
have to
do to simulate this is to just check which header files are in the library
folder,
and include them manually, which is better, especially in your situation.
Original comment by frank.zhao.main@gmail.com
on 5 Oct 2009 at 3:28
for your reference, the defined macros are listed here
http://www.nongnu.org/avr-libc/user-manual/using_tools.html
Original comment by frank.zhao.main@gmail.com
on 5 Oct 2009 at 3:34
Interestering. The library you refer to doesnt exist here.. i will upload a pic
of
the configuration..
By the way - the same errors occur on using #include "default_tlc_config.h"
instead of #include "tlc_config.h"
Original comment by mamage...@gmail.com
on 9 Oct 2009 at 3:43
Attachments:
weird, i had no problems compiling a sketch with that library a few days ago
this is another reason why i think arduino has a bad design... the utilities
folder
within a library is supposed to be treated as though it is in the same folder
as the
library, this breaks portability completely, almost making arduino libraries
useless
for normal C and C++ projects
Original comment by frank.zhao.main@gmail.com
on 9 Oct 2009 at 4:46
Wonderful!! Version32 did solve the problem :0)
It even seems like i can use my old Arduino codes without any change except
telling
the compiler the 'new' functions on top of the file - but besides that -
perfect!
Original comment by mamage...@gmail.com
on 10 Oct 2009 at 8:25
what do you mean by that? i just checked and function prototype generation
still works.
Original comment by frank.zhao.main@gmail.com
on 10 Oct 2009 at 5:17
I mean that i dont have to include any other headers than i have to with the
Arduino
ide - so in the end there seems to be a 99% compatibility now. The only
difference to
th Arduino ide is, that you have to declare the names of functions 'below'
loop() at
the top of the file.
Original comment by mamage...@gmail.com
on 11 Oct 2009 at 9:44
you shouldn't have to, weird, i can put my functions anywhere i want, above the
caller, below, from another file, etc, and never have to write the prototype
go into the temp folder in your appdata folder and check the
arduino_temp_main.cpp file
the function prototypes should be added for you
my code should work identical to how arduino does it
Original comment by frank.zhao.main@gmail.com
on 11 Oct 2009 at 3:32
Original comment by frank.zhao.main@gmail.com
on 16 Oct 2009 at 7:26
Original issue reported on code.google.com by
mamage...@gmail.com
on 4 Oct 2009 at 2:27Attachments: