-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
templates must have C++ linkage #43
Comments
I have the same problem and it is related to the emcc version. The oldest installable emcc version is 1.38.33, but this version has the same error you mention. I have tried with the latest version (1.39.5) without luck. Is there anyone succeeds to install this Mbed-Simulator with the latest Emscripten version? |
Thanks Sudobrain, what OS did you use ? By the look of it, it seems to be a generic issue? Cheers! |
I am using Ubuntu 16.04. |
I'm running into the same problem on macos. Is there any chance that this bug can be fixed? |
The answer is in the /issues/44. |
Thanks @sudobrian , I also found this issue ofter I wrote my comment, sorry for not looking earlier. Did you find out how to get this old Emscripten version? I try to install the mbed simulator for the first time and don't have any old emscripten release lying around. |
I tried to find one online but no luck, but I do have the directory installed last year. I can provide you but I need to check the licence regarding distribution. ============ Permission is hereby granted, free of charge, to any person obtaining a copy |
I'm also having the same issue on Win10 x64 - clean install (on a VM)
|
Any suggestion to resolve this problem? |
For anyone who reads this. I'm no longer working at Arm, and no-one within Arm has picked the project up, and it will no longer be maintained. I'd suggest to look at Fast Models (https://developer.arm.com/tools-and-software/simulation-models/fast-models) or other simulation techniques which are supported. |
Updated instructions in the README now (tested on Ubuntu 18). |
Hi,
I followed your steps to build the blinky example. I'm using a Mac.
No matter what I try, I'm always seeing the following error: "/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:101:1: error: templates must have C++ linkage"
=============Full error message below==============
C02ZK0Q0LVDN:mbed-simulator shuhan01$ node cli.js -i demos/blinky -o out --launch
libmbed.bc does not exist. Building...
'mbed deploy' did not run before, running...
Failed to build libmbed (1)
cache:INFO: generating system asset: is_vanilla.txt... (this will be cached in "/Users/shuhan01/.emscripten_cache/is_vanilla.txt" for subsequent builds)
cache:INFO: - ok
shared:WARNING: Assuming object file output in the absence of
-c
, based on output filename. Please add with-c
or-r
to avoid this warning/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/features/lorawan/LoRaWANStack.cpp:911:18: warning: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
_lw_session.uplink_counter, _lw_session.downlink_counter);
^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-trace/mbed-trace/mbed_trace.h:127:79: note: expanded from macro 'tr_debug'
#define tr_debug(...) mbed_tracef(TRACE_LEVEL_DEBUG, TRACE_GROUP, VA_ARGS) //!< Print debug message
^~~~~~~~~~~
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/features/lorawan/LoRaWANStack.cpp:911:46: warning: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
_lw_session.uplink_counter, _lw_session.downlink_counter);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-trace/mbed-trace/mbed_trace.h:127:79: note: expanded from macro 'tr_debug'
#define tr_debug(...) mbed_tracef(TRACE_LEVEL_DEBUG, TRACE_GROUP, VA_ARGS) //!< Print debug message
^~~~~~~~~~~
2 warnings generated.
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/features/lorawan/lorastack/mac/LoRaMac.cpp:910:43: warning: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
tr_debug("RX1 slot open, Freq = %lu", _params.rx_window1_config.frequency);
~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%u
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-trace/mbed-trace/mbed_trace.h:127:79: note: expanded from macro 'tr_debug'
#define tr_debug(...) mbed_tracef(TRACE_LEVEL_DEBUG, TRACE_GROUP, VA_ARGS) //!< Print debug message
^~~~~~~~~~~
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/features/lorawan/lorastack/mac/LoRaMac.cpp:939:43: warning: format specifies type 'unsigned long' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
tr_debug("RX2 slot open, Freq = %lu", _params.rx_window2_config.frequency);
~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%u
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-trace/mbed-trace/mbed_trace.h:127:79: note: expanded from macro 'tr_debug'
#define tr_debug(...) mbed_tracef(TRACE_LEVEL_DEBUG, TRACE_GROUP, VA_ARGS) //!< Print debug message
^~~~~~~~~~~
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/features/lorawan/lorastack/mac/LoRaMac.cpp:1132:65: warning: format specifies type 'unsigned long' but the argument has type 'lorawan_time_t' (aka 'unsigned int') [-Wformat]
tr_debug("DC enforced: Transmitting in %lu ms", backoff_time);
~~~ ^~~~~~~~~~~~
%u
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-trace/mbed-trace/mbed_trace.h:127:79: note: expanded from macro 'tr_debug'
#define tr_debug(...) mbed_tracef(TRACE_LEVEL_DEBUG, TRACE_GROUP, VA_ARGS) //!< Print debug message
^~~~~~~~~~~
3 warnings generated.
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/platform/mbed_mem_trace.cpp:110:80: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
printf(MBED_MEM_DEFAULT_TRACER_PREFIX "m:%p;%p-%u\n", res, caller, temp_s1);
~~ ^~~~~~~
%zu
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/platform/mbed_mem_trace.cpp:116:93: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
printf(MBED_MEM_DEFAULT_TRACER_PREFIX "r:%p;%p-%p;%u\n", res, caller, temp_ptr, temp_s1);
~~ ^~~~~~~
%zu
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/platform/mbed_mem_trace.cpp:122:83: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
printf(MBED_MEM_DEFAULT_TRACER_PREFIX "c:%p;%p-%u;%u\n", res, caller, temp_s1, temp_s2);
~~ ^~~~~~~
%zu
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/platform/mbed_mem_trace.cpp:122:92: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
printf(MBED_MEM_DEFAULT_TRACER_PREFIX "c:%p;%p-%u;%u\n", res, caller, temp_s1, temp_s2);
~~ ^~~~~~~
%zu
4 warnings generated.
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/pelion-dm/pal_plat_rtos.cpp:18:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-client-pal/Source/PAL-Impl/Services-API/pal.h:25:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-client-pal/Source/PAL-Impl/Services-API/pal_configuration.h:49:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-client-pal/Configs/pal_config/mbedOS/mbedOS_default.h:46:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/targets/TARGET_SIMULATOR/device.h:33:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/targets/TARGET_SIMULATOR/objects.h:22:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/targets/TARGET_SIMULATOR/gpio_object.h:19:
In file included from /Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten.h:1:
In file included from /Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/emscripten.h:23:
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:101:1: error: templates must have C++ linkage
template<typename, typename = void> struct __em_asm_sig {};
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-client-pal/Source/PAL-Impl/Services-API/pal.h:22:1: note: extern "C" language linkage specification begins here
extern "C" {
^
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/pelion-dm/pal_plat_rtos.cpp:18:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-client-pal/Source/PAL-Impl/Services-API/pal.h:25:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-client-pal/Source/PAL-Impl/Services-API/pal_configuration.h:49:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/simple-mbed-cloud-client/mbed-cloud-client/mbed-client-pal/Configs/pal_config/mbedOS/mbedOS_default.h:46:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/targets/TARGET_SIMULATOR/device.h:33:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/targets/TARGET_SIMULATOR/objects.h:22:
In file included from /Users/shuhan01/git/mbed-simulator/mbed-simulator-hal/mbed-os/targets/TARGET_SIMULATOR/gpio_object.h:19:
In file included from /Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten.h:1:
In file included from /Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/emscripten.h:23:
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: error: explicit specialization of undeclared template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'd'; };
^ ~~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:103:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'd'; };
^ ~~~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:103:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:104:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:104:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:105:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~~~~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:105:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:106:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~~~~~~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:106:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:107:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:107:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:108:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~~~~~~~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:108:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:109:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:109:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:110:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~~~~~~~~~~
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:110:19: error: redefinition of '__em_asm_sig'
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:102:19: note: previous definition is here
template<> struct __em_asm_sig { static const char value = 'd'; };
^
/Users/shuhan01/emsdk/upstream/emscripten/system/include/emscripten/em_asm.h:111:19: error: explicit specialization of non-template struct '__em_asm_sig'
template<> struct __em_asm_sig { static const char value = 'i'; };
^ ~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
The text was updated successfully, but these errors were encountered: