Error compiling extension: code.cpp:1:23: fatal error: LedMatrix.h: No such file or directory compilation terminated


#1

Edit: Subject resolved. Thanks Allen and the makeblock_product.

Hello,

I 'm getting an error when I try compiling/uploading my extension:

-o “/root/mblock-avr/temp/build/code.o” /root/mblock-avr/temp/build/code.cpp:1:23: fatal error: LedMatrix.h: No such file or directory compilation terminated.

Failed to compile file code.cpp

See image:

The fact is that I upload correctly the 2 source files of the library (LedMatrix.h and LedMatrix.cpp):

And of course I make the corresponding include:

(to say that I have already tried too: <mislibrerias/LedMatrix.h>, <mislibrerias\LedMatrix.h>, “LedMatrix.h”, “mislibrerias/LedMatrix.h”, “mislibrerias\LedMatrix.h”, …)

However I’m still getting the same error.

Please I need help.


#2

How do I solve this problem?


#3

Hi chemamoreno,

Quick solution: simply add the arduino middleware there in the connection setting page, like below:

This should fix your issue. A lot of users forget (or they even don’t know how to add a middleware, or they don’t know they’re supposed to add a middleware for adding a device). We apologize for this thoughtless design and will add the middleware for you by default in our next update.

Best,

Allen


#4

Hi makeblock_product/Allen,

Firstly, thanks for the awesome mBlock.

As I have seen, the screenshot you put corresponds only to the creation of a device.

The problem is that what I am trying to build is an extension, not a device.

In any case, I had already added the middleware in my extension (specifically in: “Basic information / Support device/sprite: arduino_uno / Upload middleware: arduino_uno / arduino / Name: arduino”).

However, I have not found anywhere the “Connection settings” section within the extension interface.

So, How can I solve this issue from the extension creation’s interface? or on the contrary I’m obliged to create a device from devices’s interface to can add .h and.cpp source files?

Thanks and greetings.


#5

Hi chemamoreno,

Sorry for getting your wrong. After checking carefully. There is indeed a section where you could add a middleware even in creating extension instead of device.

In the “Basic Information” page and “Upload middleware” section, you could add a middleware, like below:

Then you could add “arduino” there:

Hope this is helpful. Again, this might be confusing and easily overlooked for beginners and we promise we will improve it with more detailed guidance in our next update.

Thanks for asking question like this, and it helps our product progress along with you.

Best,

Allen


#6

Hi Allen,

Well, then I still have the same problem, since as I explained before, I had already added the middleware in my extension from the beginning exactly as you show on the new screenshots you have put.

It is a shame not to be able to add/use .h and.cpp source files on my extension.

Greetings.


#7

Hi chemamoreno,

Sorry our previous method didn’t help you. You said you’ve try “mislibrerias\LedMatrix.h” when including the file. Should the “ actually be " ? These two are in fact different signals that people are easy to be confused with.

Can you please try " mislibrerias/LedMatrix.h " this time?

Best,

Allen


#8

Hi Allen,

Please, read my first post carefully, because in this I already indicated that I already tried that option that you say.

So, I still have the problem.

Greetings.


#9

Hey,

I indeed read your post carefully. I said, please use " " instead of “”. Because in you first post, you’re using “”. That’s a totally different mark. If it still doesn’t work, please check your code carefully.

Allen


#10

Edit II: OK it already works and no longer throws any error, although inexplicably, since I have not made any changes, but subject resolved.

Thanks Allen and the makeblock_product.

Edit I: I just verified that the forum post system is what is replacing my symbols " with “”.

Hi Allen,

Ah I see, sorry, but I don’t understand why those “” marks came to my post since I have never used “” programming (compiler would quickly throw errors) but regular ", In fact, I would say that it is not possible to type those “” marks from a keyboard (At least the ones I’ve used), but I understand you.

So, my marks are OK:


And my code is also OK, although my problem is not that but more elementary and is I can’t add a source file without a compilation error (not even a totally empty .h or .cpp file).

Greetings.