Hello,<br><br>I have a program called fastboot.c which #includes util_windows.h which #includes windows.h which finally #includes winbase.h where all the constants are defined. The errors I get are because the Makefile I got from CMake, doesn&#39;t find the constants, as shown:<br>
<br>/host/fastboot.h:101: warning: ISO C does not allow extra `;&#39; outside of a functi<br>/host/fastboot.c:93: error: `NOPARITY&#39; undeclared here (not in a function)<br>/host/fastboot.c:112: error: `NOPARITY&#39; undeclared here (not in a function)<br>
/host/fastboot.c:112: error: initializer element is not constant<br>/host/fastboot.c:112: error: (near initialization for `parity_names[0].value&#39;)<br>/host/fastboot.c:112: error: initializer element is not constant<br>
/host/fastboot.c:112: error: (near initialization for `parity_names[0]&#39;)<br>/host/fastboot.c:113: error: `ODDPARITY&#39; undeclared here (not in a function)<br>/host/fastboot.c:113: error: initializer element is not constant<br>
/host/fastboot.c:113: error: (near initialization for `parity_names[1].value&#39;)<br>/host/fastboot.c:113: error: initializer element is not constant<br>/host/fastboot.c:113: error: (near initialization for `parity_names[1]&#39;)<br>
/host/fastboot.c:114: error: `EVENPARITY&#39; undeclared here (not in a function)<br>/host/fastboot.c:114: error: initializer element is not constant<br>/host/fastboot.c:114: error: (near initialization for `parity_names[2].value&#39;)<br>
/host/fastboot.c:114: error: initializer element is not constant<br>/host/fastboot.c:114: error: (near initialization for `parity_names[2]&#39;)<br>/host/fastboot.c:115: error: `MARKPARITY&#39; undeclared here (not in a function)<br>
/host/fastboot.c:115: error: initializer element is not constant<br>/host/fastboot.c:115: error: (near initialization for `parity_names[3].value&#39;)<br>/host/fastboot.c:115: error: initializer element is not constant<br>
/host/fastboot.c:115: error: (near initialization for `parity_names[3]&#39;)<br>/host/fastboot.c:116: error: `SPACEPARITY&#39; undeclared here (not in a function)<br>/host/fastboot.c:116: error: initializer element is not constant<br>
/host/fastboot.c:116: error: (near initialization for `parity_names[4].value&#39;)<br>/host/fastboot.c:116: error: initializer element is not constant<br>/host/fastboot.c:116: error: (near initialization for `parity_names[4]&#39;)<br>
/host/fastboot.c:118: warning: missing braces around initializer<br>/host/fastboot.c:118: warning: (near initialization for `parity_names[5]&#39;)<br>/host/fastboot.c:118: error: initializer element is not constant<br>/host/fastboot.c:118: error: (near initialization for `parity_names[5]&#39;)<br>
/host/fastboot.c: In function `find_named_value&#39;:<br>/host/fastboot.c:125: warning: implicit declaration of function `stricmp&#39;<br>/host/fastboot.c: In function `open_device_callback&#39;:<br>/host/fastboot.c:302: warning: implicit declaration of function `sleepms&#39;<br>
/host/fastboot.c: In function `open_device&#39;:<br>/host/fastboot.c:313: warning: unused variable `timeremaining&#39;<br>/host/fastboot.c: In function `usage&#39;:<br>/host/fastboot.c:382: warning: string length `2787&#39; is greater than the length `5<br>
upport<br>/host/fastboot.c: In function `offset_and_chip_name&#39;:<br>/host/fastboot.c:729: warning: unused variable `addr&#39;<br>/host/fastboot.c: In function `arg&#39;:<br>/host/fastboot.c:845: error: `EVENPARITY&#39; undeclared (first use in this function)<br>
/host/fastboot.c:845: error: (Each undeclared identifier is reported only once<br>/host/fastboot.c:845: error: for each function it appears in.)<br>/host/fastboot.c:848: error: `NOPARITY&#39; undeclared (first use in this function)<br>
<br><br>All those constants as mentioned are in winbase.h<br><br>how can I say CMake where to look? I used include_directories ( ) and it didn&#39;t work.<br>Also:  util_windows.h is in the same directory as fastboot.c<br>
windows.h and winbase.h are in <br>    ${MYPRJ_SOURCE_DIR}/../../../usr/include/w32api<br><br>which is the one I tried to include inside include_directories ( )<br><br>Thanks a lot<br><br>Enrique<br><br><div class="gmail_quote">
On Tue, Mar 1, 2011 at 5:03 PM, Andreas Pakulat <span dir="ltr">&lt;<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 01.03.11 14:58:15, Enrique Izaguirre wrote:<br>
&gt; I tried several ways but I cannot make it work. The only thing I need to do<br>
&gt; is to add a folder which contains a windows header file, in order that it be<br>
&gt; included in the build.<br>
&gt; There must be a simple way to do it. Could you help?<br>
<br>
</div>Header files are not included into the build, they are included in a cpp<br>
source file and that cpp file is then added to the build into an<br>
add_executable call. Once you have that and if it gives you errors, post<br>
the complete error messages here.<br>
<div><div></div><div class="h5"><br>
Andreas<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br>