淘客熙熙

主题:【Question】gcc installation on linux -- 觉昌安塔克世

共:💬5 🌺1 新:
分页树展主题 · 全看首页 上页
/ 1
下页 末页
  • 家园 【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!

    • 家园 动态库路径用LD_LIBRARY_PATH,加在现有定义后面

      不过自己定制安装那么以后升级也要自己调整,很麻烦

    • 家园 还可以在编译时加路径参数

      比如:

      gcc -I/your_include_path -L/your_include_lib [other parameters] source.c

    • 家园 library的路径问题

      一般link阶段,会去/usr/lib或者

      /usr/local/lib下面找library文件,

      你可以在/usr/lib下面建立一个symbolic link,连到你实际的libc.so,应该就可以了。

      ps,其实Fedora比较好,用rpm或者yum装的东西不要自己设了。

      • 家园 Thanks very much.

        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.

分页树展主题 · 全看首页 上页
/ 1
下页 末页


有趣有益,互惠互利;开阔视野,博采众长。
虚拟的网络,真实的人。天南地北客,相逢皆朋友

Copyright © cchere 西西河