Installation of C library

Hello !

I am using a device that was supplied with a dedicated library, written in C.

How can I use this library in Arduino?

Best.

Please post a link to the library.

I wish I could, its not online ...

Best.

mu234:
I wish I could, its not online …

Can you just add it as an attachment to your next Reply?

You have not even told us what the library is for.

…R

What's the device? Give us a link to where you bought it or the relevant page at the manufacturer website.

What does the device's documentation say about the library?

If not online where is the library? You have a file on a disc? Or a bunch of files? What are their names?

You could rename the library “.c” file(s) to “.cpp” to make it a C++ library. In 99% of cases that will work.

If that doesn’t work, include the library like this:

extern "C" {
#include <TheLibrary.h>
}

That tells the compiler that the functions declared in the header file are C functions, not C++ functions. The compiler will then tell the linker the C names instead of C++ names.

Hello guys, I need help with asf.h as well.

For example, I am using a library where apparently the asf.h is missing, it least this is what arduino ide reports...

Has anybody got around/faced this problem as well? Any thoughts, solutions are more than welcome!

Best.

@mu234, do not cross-post.

Just comment out the include of "asf.h". Then you will get errors for anything that "asf.h" was supposed to provide. Work around those errors so you don't need "asf.h" anymore.

a dedicated library, written in C. How can I use this library in Arduino?

Frequently, you should be able to just put the .c file (and a .h, if there is one) in your sketch directory.
You may need to do the “extern “C”” thing on the .h file if it’s not already there.

I am using a library where apparently the asf.h is missing

If it is actually using ASF (“Atmel Software Framework”), then you’re probably in trouble. It’s a huge set of interdependent library functions, and the Arduino code doesn’t use or include it.

Hello to all!

Has any of you used the asf.h eventually, actually how did you got around it?

Best.

@mu234, stop cross-posting.