cancel
Showing results for 
Search instead for 
Did you mean: 

Display problem in the IDE with #if and #ifdef

MA4
Associate III

Hello, I am working on a project with a dual core processor (H7) and I have some display problems in my IDE (STM32CubeIDE v1.9.0). For example, I added the LWIP part to my board with #define LWIP_IPV4 1 and #define LWIP_DHCP 1.

When I am in debug mode, I can see that I pass in the code present in dhcp.c (starting with #if LWIP_IPV4 && LWIP_DHCP) but the code is totally greyed out as if LWIP_IPV4 and LWIP_DHCP were 0.

This is an example, I can observe this phenomenon elsewhere in my project.

Does anyone have a solution?

6 REPLIES 6
AScha.3
Chief II

(in C) really : >> #if LWIP_IPV4 && LWIP_DHCP << ? warning ?

 #ifdef LWIP_IPV4

If you feel a post has answered your question, please click "Accept as Solution".
MA4
Associate III

OK but it's not my code but the LWIP middleware files.

plus I don't want to modify the middleware or driver files because I can't update them if I do

ok, ... so maybe you need to have a C++ project, in c++ "#if ..." should be doing, what you want .

+ in IDE : right click on your project -> option: convert to c++ (try, but first backup your project ! )

If you feel a post has answered your question, please click "Accept as Solution".
MA4
Associate III

I close my project and open it and the problem has disappeared in many files

Yes, it's help but I don't want to duplicate files, I know it's can works without, maybe it's a loading problem.