688 views
in Embedded Wizard Studio by
Hi, I would like to compile my EmWi application for Win32, and have downloaded and installed Visual Studio Community 2019.  I am following the instructions in here (https://ask.embedded-wizard.de/31/how-can-i-create-a-win32-application?show=31#q31), but I am having difficulty getting Visual Studio to compile my EmWi code (which has been configured for Win32).  Do you have working Win32 examples for VS community 2019 please? Thanks

1 Answer

0 votes
by
Hi Jonathan,

you can find examples for Win32 with VS '..\Documents\Embedded Wizard 9.20\Examples', all of these example do also contain an Win32 Project.

These weren't officially made with the new VS community 2019, but i have tested it with this IDE a few weeks ago and at this time I was able to build it correctly.

Can I ask you what exactly is not working?

A log from VS would be great to estimate what could be wrong.

Kind regards

Tim
by
Hi Tim,

Thanks for your answer - I was getting confused with the examples included with EmWi studio (as you described above) and the examples provided in the development environment (in my case, for the STM32F429). :)

 

I have now got an EmWi example compiled using VS community 2019.  However, when compiling my code in VS, I'm getting lots of VS messages like "non-ASM statement in naked function is not supported" (expanded from macro EW_UNUSED_ARG).  It looks like the macro expands to (void) (aArg), but I can't really see what is wrong.  Can you help further please? Thanks

 

**UPDATE: I got VS to compile by commenting out the line void (aArg) within the macro EW_UNUSED_ARG.  Not sure why though...
by

Hello Jonathan,

one question: do you have eventually modified the MSVC configuration to use CLANG instead of MSVC own compiler? When I'm looking for this message I see it appears only in context of CLANG compiler.

Regarding the message itself: we use so-called 'naked' functions often in code generated for MSVC. They contain inline-assembler code for optimization purpose. MSVC, however, reports a warning if the function arguments have not been used within the function. This is of course not true, since the arguments are used either in the inline-assembler or in some code invoked from the inline assembler. The MSVC compiler was not able to understand this optimization. To disable this warning we add the EW_UNUSED_ARG macro with the respective argument. Now, evidently, MSVC 2019 (with CLANG???) has a problem with this macro. 

Because we are in a very late stage of preparing the next official release 9.30 we don't plan to address this issue now. What can you do instead:

option 1: Don't use CLANG.

option 2: Use MSVC 2012 Express. It is still available.

option 3: If the message is a warning, you can disable it in settings of MSVC project.

option 4: Modify the declaration of the macro EW_UNUSED_ARG() directly within the ewrte.h file.

Best regards

Paul Banach

 

by
Hello Paul,

Thanks very much for your reply.  You are correct: I get this problem when the MSVC toolset is set to LLVM (which I believe is related to the CLANG), and not when using the standard Microsoft Visual Studio 2019 compiler (in my case, v142).

I can of course use the MS compiler, no problem.  However, I found that when using the LLVM compiler, the "non-ASM statement in naked function is not supported" statement is an Error, and so prevents the compiler from completing (and producing a .exe file).  Actually, I don't have a solution in this case - even when the definition of the macro EW_UNUSED_ARG in ewrte.h (line 968) is commented out, the compiler still stops (with a different error message) and fails to complete.

Thanks for your interest!

Best regards,

Jonathan
by

Hello Jonathan,

instead of commenting out the EW_UNUSED_ARG() macro in ewrte.h define it as empty macro:

#define EW_UNUSED_ARG( aArg )

Does it help?

Best regards

Paul Banach

by
Hi Paul,

That's what I did (in ewrte.h):

#define EW_UNUSED_ARG( aArg )                                                    \
  //(void)( aArg )  THIS LINE COMMENTED OUT

...and after a build attempt, the error message was "could not open /LTCG:incremental: no such file or directory".

At this point, I decided to remain with the MS compiler and use that!

Best regards,

Jonathan

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...