Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Libtool´´½¨ºÍʹÓÃlinux϶¯Ì¬¿â

Îļþfun.c£¬fun.h£¬hello.c£¬hello.h£¬main.c¶¯Ì¬¿âº¯Êý¶¼ÔÚfun.cºÍhello.cÀïÃæ
----------------------------
fun.c:
int add(int a, int b)
{
 return a+b;
}
fun.h:
#ifndef _FUN_H_11
#define _FUN_H_11
int add(int a, int b);
#endif
----------------------------
hello.c:
££i nclude <stdio.h>
void output(char *ss)
{
 printf("HELLO  %s\n", ss);
}
hello.h
#ifndef HELLO_H_111
#define HELLO_H_111
void output(char *ss);
#endif
----------------------------
main.c:
££i nclude <stdio.h>
££i nclude "hello.h"
££i nclude "fun.h"
void
main()
{
 output("world");
 printf("Test Value:%d\n", add(1, 2));
}
---------------------------------
ʹÓÃlibtools´´½¨ºÍʹÓð²×°¶¯Ì¬¿â²½Öè:
(1)
libtool --mode=compile gcc -g -O -c hello.c
libtool --mode=compile gcc -g -O -c fun.c
libtool --mode=compile gcc -g -O -c main.c
#Éú³É¸÷×ÔµÄoÎļþ
(2)
libtool --mode=link gcc -g -O -o libhello.la hello.lo fun.lo -rpath /usr/local/lib -lm
#Á¬½Ó³É¶¯Ì¬¿âÎļþ
(3)
libtool --mode=link gcc -g -O -o test main.o libhello.la -lm
#Á¬½ÓÉú³É¿ÉÖ´ÐÐÎļþtest
(4)
libtool --mode=install cp libhello.la /usr/local/lib/libhello.la
libtool --mode=install install -c libhello.la /usr/local/lib/libhello.la
libtool -n --mode=finish /usr/local/lib
libtool install -c test /usr/local/bin/test
#°²×°¶¯Ì¬¿â
È»ºó¾Í¿ÉÒÔÔËÐÐ/usr/local/bin/testÁË,µ±È»Â·¾¶¿ÉÒÔÈÎÒâÉèÖÃ,ÕâÊÇÊÖ¶¯¹ý³Ì,д³ÉMakefileÎļþΪ:
OBJS = fun.o hello.o
LO_OBJS = main.lo fun.lo hello.lo
PACKAGE_VERSION = 1:1:1
LIBDIR=/usr/local/lib
all : test
install : libhello.la
 
test : libhello.la main.o
 libtool --mode=link gcc -g -O -o test main.o libhello.la -lm
libhello.la : $(OBJS)
 libtool gcc -g -O -o libhello.la $(LO_OBJS) -rpath ${LIBDIR} -lm -version-info ${PACKAGE_VERSION}
main.o : main.c fun.h hello.h
 libtool --mode=compile gcc -g -O -c main.c
fun.o : fun.c fun.h
 libtool --mode=compile gcc -g -O -c fun.c
hello.o : hello.c hello.h
 libtool --mode=comp


Ïà¹ØÎĵµ£º

LinuxÐźÅÁбí

ÔËÐÐÈçÏÂÃüÁ¿É¿´µ½LinuxÖ§³ÖµÄÐźÅÁÐ±í£º
$ kill -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE
9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2
13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD
18) S ......

WindowsÓëVmwareϵÄLinuxÎļþ¹²Ïí·½Ê½1

WindowsºÍLinux¼äÓкܶàÎļþ¹²ÏíµÄ·½Ê½£¬¸ù¾ÝÍøÂç×ÊÁÏ×ܽáÈçÏ¡£
1.ÓÃvmware tools¹¤¾ß
2.ÔÚLinuxÏÂÅäÖÃApahce»òÕßFtp
3.µÚÈý·½¹¤¾ß£¬ÀýÈçSSHµÈ
4.ÀûÓÃSamba
5.ÀûÓÃWindowsµÄÎļþ¹²Ïí¹¦ÄÜ
6.Ö±½Ó¹Ò½ÓÎïÀíÓ²ÅÌ»òÕßÓ²ÅÌ·ÖÇø
7.ÓÃISOÎļþ
8.WindowsÏÂÅäÖÃWWW·þÎñ»òÕßFtp
 
½ñÌ죬ÎÒÒª½éÉܵÄÊÇÎÒÒѾ­³É¹¦×öµ½µÄÒ ......

[linux]

ʵÀý½â˵ fdisk ʹÓ÷½·¨
×÷Õߣº±±ÄÏÄϱ±
À´×Ô£ºLinuxSir.Org
ÌáÒª£ºfdisk ÊÇÒ»¿î¹¦ÄÜÇ¿´óµÄ·ÖÇø¹¤¾ß£¬Ò²ÊÇĿǰÔÚUnixÀà²Ù×÷ϵͳÖÐ×îÁ÷ÐеŤ¾ßÖ®Ò»£»·ÖÇø¹¤¾ßÀÏ×ֺţ»±¾ÆªÖ»½éÉÜÆä×î¼òµ¥µÄ·ÖÇø²Ù×÷¹¦ÄÜ£»
Ò»¡¢fdisk µÄ½éÉÜ£»
fdisk - Partition table manipulator for Linux £¬Òë³ÉÖÐÎĵÄÒâ˼ÊÇ´ÅÅÌ·ÖÇø±í²Ù×÷¹¤¾ß£»± ......

Linuxϵͳpkg


Ò»¡¢±àÒëºÍÁ¬½Ó
        Ò»°ãÀ´Ëµ£¬Èç¹û¿âµÄÍ·Îļþ²»ÔÚ /usr/include Ŀ¼ÖУ¬ÄÇôÔÚ±àÒëµÄʱºòÐèÒªÓà -I ²ÎÊýÖ¸¶¨Æä·¾¶¡£ÓÉÓÚͬһ¸ö¿âÔÚ²»Í¬ÏµÍ³ÉÏ¿ÉÄÜλÓÚ²»Í¬µÄĿ¼Ï£¬Óû§°²×°¿âµÄʱºòÒ²¿ÉÒÔ½«¿â°²×°ÔÚ²»Í¬µÄĿ¼Ï£¬ËùÒÔ¼´Ê¹Ê¹ÓÃͬһ¸ö¿â£¬ÓÉÓÚ¿âµÄ·¾¶µÄ²»Í¬£¬Ôì³ÉÁËÓà -I ²ÎÊýÖ¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ