读书笔记 - Beginning Linux Programming - Chapter 1 Getting Started

Key word:

GNOME

KDE,

Qt

CDT

 

Application:

/usr/bin: Applications supplied by the system for general use, including program development。

/usr/local/bin or /opt: Applications added by system administrators for a specific host computer or local network

For development and personal applications it’s best just to use a folder in your home directory

 

/usr/include: header files

 

$ gcc -I/usr/openwin/include fred.c
Direct the compiler to look in the directory /usr/openwin/include, as well as the standard places,for header files included in the fred.c program

 

It’s often convenient to use the grep command to search header files for particular definitions and function prototypes.

 

/lib and /usr/lib

 

$ gcc -o fred fred.c /usr/lib/libm.a
$ gcc -o fred fred.c
$ gcc -o x11fred -L/usr/openwin/lib x11fred.c -lX11

 

Static Library

/usr/lib/libc.a and /usr/lib/libX11.a

 

$ g++ -c bill.cpp fred.cpp

$ ls *.o
bill.o fred.o

$ g++ -c program.cpp
$ g++ -o program program.o bill.o
$ ./program
bill: we passed Hello World

 

Item UNIX Windows
object module func.o FUNC.OBJ
static library lib.a LIB.LIB
program program PROGRAM.EXE

 

Shared lib is just like dynamic library in windows

*.so

$ ldd program
    linux-gate.so.1 =>  (0x006f6000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00c35000)
    libm.so.6 => /lib/libm.so.6 (0x009b4000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00217000)
    libc.so.6 => /lib/libc.so.6 (0x00703000)
    /lib/ld-linux.so.2 (0x00429000)

 

use man and info to view the documentation

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值