ライブラリにいくつかの変更を加えたいと思いglibcます。最初のステップは、プログラムをコンパイルするときに特定のバージョンを使用できるようにすることです。私はubuntu 12.10を使用しており、ディレクトリは次のとおりです。
/mydirectory/glibc-2.17 (where I have extracted the last version from the website)
/mydirectory/glibc-2.17-build (where I have executed the configure and make command)
/mydirectory/test/helloworld.c (where I have my helloworld program)
はhelloworld.c次のとおりです。
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
char glibc[256] = "xxxx"; /* How to detect the glibc version here ? */
printf("hello, world\n");
printf("glibc version = %s\n", glibc);
return 0;
}
まず、バージョンを印刷するにはどうすればよいglibcですか? (そのためのマクロ/定数がglibcにあると思います)。
helloworld.c第二に、ファイルをコンパイルして にある を使用するには、どのコマンド ラインを使用する必要glibcがあり/mydirectory/glibc-2.17-buildますか?