ライブラリにいくつかの変更を加えたいと思い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
ますか?