glibc

implicit declaration using -std=c99

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm getting this warning: ( -std=c99 -pedantic ) warning : implicit declaration of function ‘ strndup ’ [- Wimplicit - function - declaration ] but I'm importing these libs: #include #include #include So what?! :( // file.c: #include "file.h" strndup (...) // file.h: #include #include #include 回答1: The issue is your usage of the -std=c99 option. Since strndup() isn't part of C99, and you're asking the compiler to go into standards compliant mode, it won't provide the prototype for it. It still links of course, because your C

How to allocate an input file instead of the stdin in an Eclipse CDT application?

匿名 (未验证) 提交于 2019-12-03 01:43:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My application is a simple executable used from the command line and takes stdin as input and stdout as output, so it behaves like many GNU tools. To test it, I want to set up an Eclipse CDT DEBUG Configuration to pass a file to stdin and another one to stdout . I have tried unsuccessfully a few solutions, all inside the DEBUG Configuration GUI : In Common / Standard Input and Output / Input File: I put inputfile.txt and in the same section Output file: I put outputfile.txt . As the GUI indicates that the working directory is ${workspace_loc

glibc: elf file OS ABI invalid

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: downloaded and compiled glibc-2.13. when i try to run a sample C program which does a malloc(). I get following error elf file OS ABI invalid Can anybody please pass my any pointer helpful in resolving this issue.Please note that my kernel version is linux-2.6.35.9 回答1: It's not your kernel version that's the problem. The loader on your system does not support the new Linux ABI. Until relatively recently, Linux ELF binaries used the System V ABI. Recently, in support of STT_GNU_IFUNC, the Linux ABI was added. You would have to update your

Pyinstaller GLIBC_2.15 not found

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Generated an executable on Linux 32-bit Ubuntu 11 and tested it on a 32-bit Ubuntu 10 and it failed with a "GLIBC_2.15" not found. 回答1: Cyrhon FAQ section says: Under Linux, I get runtime dynamic linker errors, related to libc. What should I do? The executable that PyInstaller builds is not fully static, in that it still depends on the system libc. Under Linux, the ABI of GLIBC is backward compatible, but not forward compatible. So if you link against a newer GLIBC, you can't run the resulting executable on an older system. The supplied

Ubuntu Linux C++ error: undefined reference to 'clock_gettime' and 'clock_settime'

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am pretty new to Ubuntu, but I can't seem to get this to work. It works fine on my school computers and I don't know what I am not doing. I have checked usr/include and time.h is there just fine. Here is the code: #include #include using namespace std; int main() { timespec time1, time2; int temp; clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1); //do stuff here clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2); return 0; } I am using CodeBlocks as my IDE to build and run as well. Any help would be great, thank you. 回答1: Add -lrt to the end

glibc rand function implementation

匿名 (未验证) 提交于 2019-12-03 01:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm reading c standard library rand() function implementation with glibc source code. stdlib/random_r.c, line 359 int __random_r (buf, result) struct random_data *buf; int32_t *result; { int32_t *state; if (buf == NULL || result == NULL) goto fail; state = buf->state; if (buf->rand_type == TYPE_0) { int32_t val = state[0]; val = ((state[0] * 1103515245) + 12345) & 0x7fffffff; state[0] = val; *result = val; } else { int32_t *fptr = buf->fptr; int32_t *rptr = buf->rptr; int32_t *end_ptr = buf->end_ptr; int32_t val; val = *fptr += *rptr; /*

Install glibc2.16 in Ubuntu 12.04

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Ubuntu 12.04 and the binary I'm trying to run needs glibc2.16, I tried updating glibc by using apt-get install libc6 but only glibc2.15 got installed , can someone suggest me how to get glibc 2.16 in my machine. Sorry if this question doesn't belong here, but I couldn't find any resource. 回答1: You need to upgrade to a newer Ubuntu version, or recompile the software which currently needs glibc 2.16 specifically for Ubuntu 12.04, so that it will work with that older glibc version. Upgrading glibc has far-reaching consequences. I don

Purpose of __USE_XOPEN2K8 and how to set it?

匿名 (未验证) 提交于 2019-12-03 00:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to compile the gtk stack (the last gtk2 version, 2.24), and I am getting a bunch of errors that seem related. Namely, the __locale_t can't be found from string.h and time.h, and LC_ALL_MASK can't be found either (should be in locale.h). I found that all of these problems are related to __USE_XOPEN2K8 not being #defined. What is __USE_XOPEN2K8 for, and how can I set it propertly? For example, do I have to pass a flag to ./configure for glib, gtk, ... or do I have to change something already while building gcc or glib ? I'd rather

yum报错:Requires: libc.so.6(GLIBC_2.17)(64bit)

匿名 (未验证) 提交于 2019-12-03 00:43:02
在安装最新版teamviewer即yum install teamviewer_13.1.8286.x86_64.rpm的过程中,出现报错 Error: Package: teamviewer-host-13.1.1548-0.x86_64 (/teamviewer-host.x86_64) Requires: libc.so.6(GLIBC_2.17)(64bit) 去网上手动下载,在http://rpm.pbone.net 中搜索glibc-2.17 发现2.17版本对应的linux版本为centos7或者redhat7,也就是说我用的redhat6.8是没有办法安装的!坑爹啊! 解决方法:选择redhat7以上的版本(亲测可行),或者选teamviewer的低版本! 原文:http://blog.51cto.com/10249069/2148795

升级gcc与glibc

匿名 (未验证) 提交于 2019-12-03 00:32:02
一、更新glibc 建立目录glibc-2.20-build,并将glibc-2.20.tar.gz放入 mkdir glibc-2.20-build cd glibc-2.20-build cd glibc-2.20 mkdir glibc_build cd glibc_build ../configure --prefix=/usr --disable-profile--enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make make install 之后的检查确认: ll /lib64/libc* strings /lib64/libc.so.6 | grep GLIBC 二、更新gcc 建立目录gcc-6.1.0-build,将gcc-6.1.0.tar.bz2放入 make install 之后的检查确认: ls/usr/local/bin | grep gcc g++ --version 三、更新libstdc++.so.6.动态库 cd /usr/lib64 cp~/gcc-6.1.0-build/gcc-6.1.0/gcc-build-6.1.0/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.22 .