Serial.print not working in .cpp library

Hi,

I have a .cpp and .h file which I used to upload into arduino create as a library.

lets call it mylib.cpp and mylib.h

in my main.ino file I did the following

#include <mylib.h>

MyLib* foo = new MyLib();

void setup()
{
Serial.begin(115200)

}

void loop()
{
Serial.println("main loop ");
foo->myfunc(); // <— debug statment resides in here
}

in the mylib.cpp file I used Serial.print (“debug statements”).

It appears that arduino create does not show the print statements.

can anyone help me with this ?

my program compiles just fine.

The program is able to print debug statements in my main.cpp file just fine.
I just can’t see the Serial.print messages which come from the library

Cheers

Hi @meat030, could you please directly share your sketch link?

Hi Guys,

the weirdest thing has happened.

When I included the .cpp and .h file into my sketch and deleted the uploaded library ...everything worked as expected.

I then removed the .cpp and .h files from my sketch and reintroduced the libraries and they still work.

So not quite sure if this is still a problem.

I will keep going. if not I will post again in the next few days.

resolved for now