Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Cannot compile C++ code

Hi
I just tried out mJS, and I got a C hello world function to work immediately. I cannot however, compile a second (C++) file. The second file has a header file (tried .h and .hpp) which is included in he second file, and the other (C) file. I try to call a function in the .cpp file from the .c file. I get:
LD /app/build/objs/mjs_hello.elf
/app/build/objs/hw.c.o:(.text.helloworld+0x4): undefined reference to `cpphelloworld'
if I rename the second file to .c, without any other changes it works!
It should be possible to run C++, right?
btw I am using default cloud compile....
Thank you all,
Sean

Comments

Sign In or Register to comment.