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't find the constants, as shown:<br>
<br>/host/fastboot.h:101: warning: ISO C does not allow extra `;' outside of a functi<br>/host/fastboot.c:93: error: `NOPARITY' undeclared here (not in a function)<br>/host/fastboot.c:112: error: `NOPARITY' 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')<br>/host/fastboot.c:112: error: initializer element is not constant<br>
/host/fastboot.c:112: error: (near initialization for `parity_names[0]')<br>/host/fastboot.c:113: error: `ODDPARITY' 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')<br>/host/fastboot.c:113: error: initializer element is not constant<br>/host/fastboot.c:113: error: (near initialization for `parity_names[1]')<br>
/host/fastboot.c:114: error: `EVENPARITY' 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')<br>
/host/fastboot.c:114: error: initializer element is not constant<br>/host/fastboot.c:114: error: (near initialization for `parity_names[2]')<br>/host/fastboot.c:115: error: `MARKPARITY' 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')<br>/host/fastboot.c:115: error: initializer element is not constant<br>
/host/fastboot.c:115: error: (near initialization for `parity_names[3]')<br>/host/fastboot.c:116: error: `SPACEPARITY' 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')<br>/host/fastboot.c:116: error: initializer element is not constant<br>/host/fastboot.c:116: error: (near initialization for `parity_names[4]')<br>
/host/fastboot.c:118: warning: missing braces around initializer<br>/host/fastboot.c:118: warning: (near initialization for `parity_names[5]')<br>/host/fastboot.c:118: error: initializer element is not constant<br>/host/fastboot.c:118: error: (near initialization for `parity_names[5]')<br>
/host/fastboot.c: In function `find_named_value':<br>/host/fastboot.c:125: warning: implicit declaration of function `stricmp'<br>/host/fastboot.c: In function `open_device_callback':<br>/host/fastboot.c:302: warning: implicit declaration of function `sleepms'<br>
/host/fastboot.c: In function `open_device':<br>/host/fastboot.c:313: warning: unused variable `timeremaining'<br>/host/fastboot.c: In function `usage':<br>/host/fastboot.c:382: warning: string length `2787' is greater than the length `5<br>
upport<br>/host/fastboot.c: In function `offset_and_chip_name':<br>/host/fastboot.c:729: warning: unused variable `addr'<br>/host/fastboot.c: In function `arg':<br>/host/fastboot.c:845: error: `EVENPARITY' 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' 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'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"><<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>></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>
> I tried several ways but I cannot make it work. The only thing I need to do<br>
> is to add a folder which contains a windows header file, in order that it be<br>
> included in the build.<br>
> 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>