I see this behaviour as well with gcc 4.6.3 using the libcryptset.h from git.<br><br>Some quick searching on Googe leads me to believe that size_t is supposed to be in stddef.h. Like you noted simply adding that fixes the compilation.<br>
<br>diff --git a/lib/libcryptsetup.h b/lib/libcryptsetup.h<br>index 2b10add..e4b384f 100644<br>--- a/lib/libcryptsetup.h<br>+++ b/lib/libcryptsetup.h<br>@@ -33,6 +33,7 @@<br> extern "C" {<br> #endif<br> <br>+#include <stddef.h><br>
 #include <stdint.h><br> <br> struct crypt_device; /* crypt device handle */<br><br><div class="gmail_quote">On Mon, May 28, 2012 at 12:42 AM, .. ink .. <span dir="ltr"><<a href="mailto:mhogomchungu@gmail.com" target="_blank">mhogomchungu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">#include <libcryptsetup.h><br>
<br>
int main( void )<br>
{<br>
        return 0 ;<br>
}<br>
<br>
A source file with the above code named "crypt.c" errors out when<br>
compiling it with the following command:<br>
<br>
gcc -o crypt crypt.c -I/include<br>
<br>
"libcryptsetup.h" is located at "'/include" in my distro.<br>
gcc version is 4.5.1.<br>
<br>
The compile pass if i add any standard library header i have tried<br>
above the libcryptsetup.h header,if its below or not present, the<br>
compilation fail with below error. I googled why this happens but<br>
havent found anything. using cryptsetup version 1.4.2<br>
<br>
Errors produced are below.<br>
<br>
gcc -o crypt crypt.c -I/include<br>
In file included from crypt.c:3:0:<br>
/include/libcryptsetup.h:187:46: error: expected declaration<br>
specifiers or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:336:2: error: expected<br>
specifier-qualifier-list before ‘size_t’<br>
In file included from crypt.c:3:0:<br>
/include/libcryptsetup.h:380:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:474:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:492:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:493:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:501:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:537:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:539:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:573:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:574:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:576:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:577:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:584:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:586:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:606:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:608:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:686:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:706:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:707:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:716:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:738:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:770:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:772:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:785:2: error: expected declaration specifiers<br>
or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:963:59: error: expected declaration<br>
specifiers or ‘...’ before ‘size_t’<br>
/include/libcryptsetup.h:974:33: error: expected declaration<br>
specifiers or ‘...’ before ‘size_t’<br>
_______________________________________________<br>
dm-crypt mailing list<br>
<a href="mailto:dm-crypt@saout.de">dm-crypt@saout.de</a><br>
<a href="http://www.saout.de/mailman/listinfo/dm-crypt" target="_blank">http://www.saout.de/mailman/listinfo/dm-crypt</a><br>
</blockquote></div><br>