Open cogumbreiro opened 6 years ago
I think the following link is related to this issue: xlocal.h is removed of glibc as of 2.26.
Edit: This thread discusses the issue and a workaround required to build LLVM.
Hard-coding the include path to any directory in /usr/include/c++/v1/support/*
results in the following error:
In file included from /usr/include/sched.h:34:0,
from hclib-thread-bind.c:22:
/usr/include/time.h:113:5: error: unknown type name ‘locale_t’; did you mean ‘clock_t’?
locale_t __loc) __THROW;
^~~~~~~~
clock_t
I also tried following the suggestion of including locale.h
rather than xlocale.h
and obtained the same compiler error above.
Hello,
Can you try the code below? This would be just a quick fix and might not be a complete solution. But I confirmed the fix worked at least on my Ubuntu 17.10 machine and the C tests passed. I'll dive into more details, but please let me know if the fix works on your machine.
My changes include:
#include<locale.h>
before #define _GNU_SOURCE
#include<time.h>
immediately after #include<locale.h>
It seems that the locale_t error you mentioned was caused by using GNU Extensions (#define _GNU_SOURCE
and __USE_GNU
).
#include <stdio.h>
#include <locale.h>
#include <time.h>
#define _GNU_SOURCE
#define __USE_GNU
#include <xlocale.h>
#include <unistd.h>
#include <sched.h>
#include <errno.h>
@ahayashi, with your changes I don't think we need to include xlocale.h
. Here's the full patch below that allowed it to compile in my system:
@@ -15,9 +15,10 @@
*/
#include <stdio.h>
+#include <locale.h>
+#include <time.h>
#define _GNU_SOURCE
#define __USE_GNU
-#include <xlocale.h>
#include <unistd.h>
#include <sched.h>
#include <errno.h>
@cogumbreiro, oh right, I forgot to delete #include<xlocale.h>
. Yes, the full patch was what I meant.
Hi, everyone,
I'm having problems compiling hclib in Ubuntu 17.10. According to ubuntu-packages it seemed I had to install
libc++-dev
. The file is indeed installed in my system but hclib's build script is not able to find it:Any workarounds? I was expecting
configure.sh
to either find the right header or at least consider the missing header as an error.Compilation error: