当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 6 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 这段代码是什么意思?
帖子发表于 : 2008-03-25 21:44 
头像

注册: 2008-01-23 11:13
帖子: 175
送出感谢: 0 次
接收感谢: 0 次
#! /bin/csh -f
set INCLUDE = /home/ku/standard/cslib
set CSLIB = $INCLUDE/cslib.a
set LIBRARIES = ($CSLIB -lm)
foreach x ($*)
if ("x$x" == "x-c") then
set LIBRARIES = ""
break
endif
end
gcc -g -I$INCLUDE $* $LIBRARIES

我想使用这个库,该怎么做?
这个是一个gccx的文件,我用vi打开后就是这个代码,我已经把gccx放在usr/local/bin下,我想使用这个库该如何操作呢?譬如想使1.c文件使用这个库


页首
 用户资料  
 
2 楼 
 文章标题 :
帖子发表于 : 2008-03-25 22:42 

注册: 2006-03-10 15:10
帖子: 3182
地址: xi'an China
送出感谢: 0 次
接收感谢: 2
可是这只是一个 csh 的脚本,不是什么库啊?


页首
 用户资料  
 
3 楼 
 文章标题 :
帖子发表于 : 2008-03-26 8:39 
头像

注册: 2008-01-23 11:13
帖子: 175
送出感谢: 0 次
接收感谢: 0 次
csh可以一直运行吗?


页首
 用户资料  
 
4 楼 
 文章标题 :
帖子发表于 : 2008-03-26 8:46 
头像

注册: 2006-04-12 20:05
帖子: 8495
地址: 杭州
送出感谢: 0 次
接收感谢: 8
这段脚本只是设置了几个环境变量,然后调用gcc而已,要运行还得先安装 csh .


_________________
关注我的blog: ε==3


页首
 用户资料  
 
5 楼 
 文章标题 :
帖子发表于 : 2008-03-26 22:36 
头像

注册: 2008-01-23 11:13
帖子: 175
送出感谢: 0 次
接收感谢: 0 次
这个是那个文件的说明,请帮帮忙看看
README file for the standard subdirectory
Last modified on Thu Oct 20 13:13:48 1994 by eroberts
________________________________________________________________________

The standard directory contains a completely portable implementation of
the cslib library for use with the textbook "The Art and Science of C: A
Library-Based Approach" (Addison-Wesley, 1995).

The graphics library provided in this directory is a machine-independent
implementation that writes a data file called graphics.ps that can then
be sent to a PostScript printer. If you want to draw actual figures on
the screen, you need a version of graphics.c that has been tailored for
use with your specific system. Several implementations of graphics.c
are included in other subdirectories (unix-xwindows, mac-think-c, and
pc-borland) of the cslib directory.

INSTALLING THE STANDARD LIBRARIES

First of all, make sure that the standard version of the libraries is
the one you want to install. If you are running on one of the platforms
for which the full cslib library package is implemented (XWindows on
Unix, Borland C/C++ on the IBM PC, or THINK C or Symantec C++ on the
Macintosh), you should be installing the version that was designed for
that system. The cslib library produced by those packages is not only
more powerful but also easier to install.

The steps required to install the standard library package depend very
much on what type of computer system and C compiler you have. If you
are running on a Unix system, you should adopt the following procedure:

TO INSTALL THE STANDARD VERSION OF THE LIBRARIES ON A UNIX SYSTEM:

1. Use FTP to retrieve the file standard.shar to the home directory on
your machine.

2. Execute the standard.shar script by typing

sh standard.shar

This step creates a top-level directory called cslib that contains
all of the relevant files.

3. Connect to the cslib directory.

4. Rebuild the object files and libraries by typing

make

5. Copy the file gccx from the cslib directory into a directory on your
command search path. If you will be the only person using the
libraries, you could put this file in your private command
directory, which is usually ~/bin. If you are installing this
command for use by any user on the system, you will need to put it
in a public directory, such as /usr/local/bin. For public
installation to work, your cslib directory must be readable by other
users.

If you are not using a Unix system, you should instead adopt the
following more general approach, filling in details as appropriate for
your own hardware and software platform:

1. Use FTP to copy all of the files in the standard directory to a new
working directory on your machine.

2. Copy the .h files from this directory into the standard #include
path used by your compiler.

3. Compile each of the source files (exception.c, genlib.c, graphics.c,
random.c, simpio.c, and strlib.c) to produce the corresponding
object file.

4. Combine the object files together to produce a library file. The
steps required to do so vary substantially from system to system.

5. If you are installing this package on a shared machine, copy the
library into some public directory where students can easily gain
access to it.

NOTES AND DISCLAIMERS

The cslib libraries are in the public domain and may be freely copied
and distributed, although they remain under development. No warranties
are made concerning their correctness or stability, and no user support
is guaranteed. Bug reports and suggestions, however, are appreciated
and may be sent to

Eric Roberts <ericr@aw.com>
其中gccx就是那个csh文件脚本


页首
 用户资料  
 
6 楼 
 文章标题 : Re: 这段代码是什么意思?
帖子发表于 : 2009-05-02 13:26 

注册: 2006-06-05 22:12
帖子: 42
送出感谢: 0 次
接收感谢: 0 次
1) Modify the gccx according to where you put the /cslib.

2) install csh if you have not do that yet.

代码:
 sudo apt-get install csh


3) After you copied the gccx into /user/local/bin/gccx, do not forget to make it executable!

代码:
 sudo chmod 777 gccx


In the future, when compiling and linking the source code requiring cslib, use gccx instead of gcc.

If you are using Anjuta, simply do the following:

Setting ---> Commands
引用:
Compile: gccx $(anjuta.compiler.flags) -c "$(current.file.name.ext)" -o "$(current.file.name).o"
Build a File: gccx $(anjuta.compiler.flags) "$(current.file.name.ext)" $(anjuta.linker.flags) -o "$(current.file.name)"


i.e. change gcc to gccx


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 6 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译