Loading...
 

System Workbench for STM32


You are viewing a reply to How do I compile a .h file?  

How do I compile a .h file?

Thank you for the response.

I have checked and main.h is included in multiple locations. Maininclude1 Maininclude2

I have also done what you suggested and searched for the ENABLE_MEMS symbol and I have found all instances of it. Even after I’ve rebuilt he program the macro is still showing it as a 0. ENABLE MEMS Macro

This is really frustrating as I have looked through the code and I can see (or at least believe) that the functionality to send Acc, Gyr and Mag data is there but I don’t understand enough about this code in order to get it to work and send all sensor data over.

Hi,

Have you checked that it’s your main.h file that is included; it may happen that there are several files of the same name in different directoies and that a given include get the wrong one... To test you may search for files named “main.h” and/or put a syntax error in your file and check that you get the error message.

If you really get the main.h where you define the symbol as 1 and the code that depends on it is not compiled, that may mean that it is redefined as 0 somewhere else and setting it on the command line will probably not help.

Bernard (Ac6)


Hi again,

BTW the fact that Eclipse shows the macro expanding as 0 (which is seen also as the code itself is grayed out) may be an artifact due to indexing problems. To check you may rebuild th eindex, or go in th efile where the #if shows the value as 0 and

  1. add a syntax error in the conditionnaly compiled zone to check if it is compiled or not
  2. search which “main.h” file Eclipse think you are including by double clicking on “main.h” in the file outline (right column in your workspace): this will open the main.h file and you can check if your macro is defined as 1 or 0 (you can get the full pathname by hovering on the editor tab title).


Hope this helps

Bernard (Ac6)