cannot open source input file "mbed.h"

11 Jul 2012

I'm trying to export my project to a licensed version of uVision4 and although the export process completes successfully providing a zip file, when I open with uVision4 and try to compile, I get the error, "error: #5: cannot open source input file "mbed.h": No such file or directory" I've tried importing other people's projects with the same issues. Compilation in the online compiler works well. I've even tried importing the latest mbed build with no success. Any ideas?

11 Jul 2012

You need to import the "export" version of the mbed library:

[Repository '/users/mbed_official/code/mbed-export/latest' not found]

Cheers, Emilio

PS: in the following days we are going to merge the "online compiler" version and "export" version, therefore this step will not be required in the future.

11 Jul 2012

Excellent Emilio, thank you for your assistance.

02 Aug 2012

Is "mbed-export" required currently?
If you have updated version, please share with us.
Or, I appreciate if you can fix the "export" mechanism to include proper files.

I have following problem:

I tried exporting program to LPCXpresso(code_red) and found it was not including "mbed.h". Then I found this topic and tried...

It works fine for some programs but it is not for any programs.

If the "mbed-export" lib is used in a complex program, it gives an error with following message.

code_red error message wrote:

"/Users/okano/dev/_lpcxpresso/test2/_program_name/mbed-export/Base.h:11:19: fatal error: cstdlib: No such file or directory"

It gives errors even if compiled by mbed-compiler.
(I remember that I've seen similar message when I start beta-test for collaboration environment.)

/media/uploads/okano/error-mbed-export.png

02 Aug 2012

Tedd OKANO wrote:

/media/uploads/okano/error-mbed-export.png

I have seen errors similar to this when including mbed.h into a file with a .c extension. The problems stopped once I renamed the file to .cpp.

02 Aug 2012

Stephen Paulger wrote:

I have seen errors similar to this when including mbed.h into a file with a .c extension. The problems stopped once I renamed the file to .cpp.

Hi Stephen,

I confirmed the error can be fixed by changing file name extension. Thank you.
I hope the "export" command will be fixed soon.

02 Aug 2012

Tedd OKANO wrote:

fixed by changing file name extension

By the way, a forum post giving a bit of background about this change: Compile C as C and C++ as C++.

Cheers, Emilio

02 Aug 2012

Emilio Monti wrote:

background about this change: Compile C as C and C++ as C++.

Hi Emilio,

I understand reason of change. Thanks!