How to print a text within a file with .c extention

Good day,

I am trying to undertsand that library
Arduino lmic

and specialy that function
os_runloop_once

I searched for it in a ccp or h file but without success but I found in a .c file
os_dunloop_once function

First I was surprise to see a such file
What is it excately?

Serondly, I want to debug it by adding a

Serial.println(F("Start..."));

but when I copiled I got a such message

C:\Users\pierrot\Documents\Arduino\libraries\arduino-lmic-master\src\lmic\oslmic.c:93:5: error: ‘Serial’ undeclared (first use in this function)

Serial.println(F(“Start…”))

So, how can print variable value from a c file?

Does .c file are like extention?

Thank for your help
Cheers

Try using Serial.begin() before using Serial?

Better yet, work through more examples before taking off unprepared.

Hello

There is here (I am working with that exemple)
Serial.begin()

Does work with .c file?

Did you make a file to include with .c extent and put Serial commands in it?

Arduino compiler is a bit funny about included files and scope. Another compiler may be what you need, you have free choices.

Arduino compiler with .ino includes Serial when Serial.begin() is used, we don't have to #include "serial.h" but maybe there is one to put in your .c file? Somehow the compiler must make an object file of the .c file in order to compile the sketch.

AFAIK, calling a C++ method like "Serial.print()" from C without jumping through some hoops, regardless of IDE/Compiler choice.

See How to call C++ function from C? - Stack Overflow

C:\Users\pierrot\Documents\Arduino\libraries\arduino-lmic-master\src\lmic\oslmic.c:93:5: error: ‘Serial’ undeclared (first use in this function)

Try adding

#include <Arduino.h>

at the top of your .c file. The IDE does this automatically for .ino files, but not for .c .

Hello!

Unfortunately, adding
#include <Arduino.h>
in the .c file does not help :o

Is there another method to debug a .c file?

Thank for helping

Perhaps I should be more assertive?

You cannot call normal C++ object methods from C code.

Whereas a .cpp file?

And IIRC Arduino is a bit non-standard about included files or has that changed since last I knew (ver 0023)?
I don't remember details, sorry.