- 程序有所改变。发帖如还有问题请报告
- 【征集】西西河的经济学,及清流措施,需要主动参与者,『稷下学宫』新认证方式,24年网站打算和努力目标
主题:【Question】gcc installation on linux -- 觉昌安塔克世
Sorry folks, I can't type Chinese right now.
I've been a Unix user for,god knows how many years,
but have never been a system manager. I installed
Linspire Linux on one of my home PCs two days ago. And
boy,do I have problems!
I have downloaded a pre-compiled gcc package,and have
unpacked it in a directory.(The unpacked stuff has the usual "bin","lib",etc.) I then
tried to compile a "Hello world" type program with the
g-plus-plus executable, and bang! --an error message was
thrown at my face, saying it could not find
"libc.so.6".
I know that this must have been caused by some
environmental variables that were not specified
correctly, but what are they? I find no documentation
on how and what to specify in the downloaded package.
And a search over the internet didn't yield anything
useful,either.
I guess that,basically,I have two questions:
(1) What environmental variables do I need to specify?
(2) Do I have to unpack the package in the "standard"
places such as "/usr/local/..."? (Right now,
everything is in some "non-standard" directory I have
created.)
I would be very grateful if anyone could give me some
tips.Thanks in advance, and Happy New Year!
一般link阶段,会去/usr/lib或者
/usr/local/lib下面找library文件,
你可以在/usr/lib下面建立一个symbolic link,连到你实际的libc.so,应该就可以了。
ps,其实Fedora比较好,用rpm或者yum装的东西不要自己设了。
I was hoping that there would be some simpler solutions. The package has many libs and executables and include files (and directories), I will have to do a lot of symbolic links then.But if that's what it takes, I will do it.
Thanks a lot.
比如:
gcc -I/your_include_path -L/your_include_lib [other parameters] source.c
不过自己定制安装那么以后升级也要自己调整,很麻烦