LINUX ϶¯Ì¬£¬¾²Ì¬Á´½Ó¿âʵս
¶ÔÓÚ¶¯Ì¬Á´½Ó¿âºÍ¾²Ì¬Á´½Ó¿âµÄ¸ÅÄîÒÔ¼°Á´½Ó·½Ê½²»ÔÙÀÛ׸¡£Ö±½Ó¿ªÊ¼ÉÏ´úÂëºÍ½øÐбàÒë¡£-__-||¡£
´úÂëºÜ¼òµ¥£¬ºáÊú¾ÍÈý¸öµ±¼ÒµÄ¡£
¿âÍ·Îļþcorey.hpp:
#ifndef LIBRARY_H
#define LIBRARY_H
void add(int,int,int*);
#endif
¿âʵÏÖÎļþcorey.cpp
#include "corey.hpp"
void add(int a,int b,int *c){
int total=a+b;
*c=total;
}
Èë¿Úº¯Êýmain.cpp:
#include "corey.hpp"
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int args,char *argc[]){
int a=1;
int b=2;
int *c;
add(a,b,c);
cout << "add result:";
cout << *c << endl << flush;
}
¾²Ì¬¿â£º
ÏȽ¨Á¢staticÎļþ¼Ð£¬½«ÈýÎļþ·Ö±ðÖÃÓÚÆäÖС£
1£©Éú³É¾²Ì¬¿â
g++ -c corey.cpp
ar -rc libcorey.a corey.o
ͬʱÇë×¢ÒâÃüÃû¡£
2£©±àÒëmain.o
gcc -I /home/corey/static -o main.o -c main.c
´Ëʱ-IÖ¸¶¨ÁËcorey.hppÎļþµÄĿ¼£¬Ä¬ÈÏ»áÈ¥/usr/includeºÍ±¾Ä¿Â¼ÖвéÕÒ£¬¿É½«Îļþ·ÅÖÃÔÚÕâÁ½¸öλÖã¬Ôò¿É²»±ÈÖ¸¶¨I¡£
ÎÒÃÇÖªµÀ±àÒëµÄʱºò£¬Ö»ÐèÒªÖ¸¶¨Í·Îļþ¼´¿É¡£
3) Á´½Ómain
gcc -o main -L/home/corey/static main.o -lcorey £¨coreyΪʡȥÁËlib,aµÄ¿âÃû£©
²¢ÇÒ²ÎÊý-l±ØÐëÔÚÊäÈëÎļþÖ®ºó¡£
ÎÒÃÇ¿ÉÒÔÑ¡Ôñ°Ñlibcorey.aÎļþ·ÅÖÃÔÚ/usr/libÎļþ¼ÐÖУ¬¿ÉÒÔÊ¡È¥Ö¸¶¨-L²ÎÊý¡£
4£©Ö´ÐÐmain
Ö´ÐÐmain³ÌÐò£¬ÎÞÐè³ÌÐò¿âµÄ²ÎÓë¡£
¶¯Ì¬¿â£º
½¨Á¢Îļþ¼Ðso,½«ÈýÎļþ·ÅÖÃÆäÖС£
1)±àÒ붯̬¿â¡£
g++ -fpic -shared -o libcorey.so corey.cpp
2£©±àÒëmain.o
gcc -I /home/corey/static -o main.o -c main.c
´Ëʱ-IÖ¸¶¨ÁËcorey.hppÎļþµÄĿ¼£¬Ä¬ÈÏ»áÈ¥/usr/includeºÍ±¾Ä¿Â¼ÖвéÕÒ£¬¿É½«Îļþ·ÅÖÃÔÚÕâÁ½¸öλÖã¬Ôò¿É²»±ÈÖ¸¶¨I¡£
ÎÒÃÇÖªµÀ±àÒëµÄʱºò£¬Ö»ÐèÒªÖ¸¶¨Í·Îļþ¼´¿É¡£
3)Á´½Ómain
gcc -o main -L/home/corey/static main.o -lcorey £¨coreyΪʡȥÁËlib,aµÄ¿âÃû£©
²¢ÇÒ²ÎÊý-l±ØÐëÔÚÊäÈëÎļþÖ®ºó¡£
ÎÒÃÇ¿ÉÒÔÑ¡Ôñ°Ñlibcorey.aÎļþ·ÅÖÃÔÚ/usr/libÎļþ¼ÐÖУ¬¿ÉÒÔÊ¡È¥Ö¸¶¨-L²ÎÊý¡£
4£©Ö´ÐÐmain
ÌáʾûÓмÓÔØ¿â
./main: error while loading shared libraries: libcorey.so: cannot open shared object file: No such file or directory
5£©echo /home/corey/so >> /etc/ld.so.conf
6£©ldconfig
7)Ö´Ðгɹ¦¡£
Ïà¹ØÎĵµ£º
Ó²¼þƽ̨
¡¡¡¡S3C2410XÊÇÈýÐǹ«Ë¾µÄ»ùÓÚARM920TµÄS3C2410XоƬ¡£S3C2410X¼¯³ÉÁËÒ»¸öLCD¿ØÖÆÆ÷(Ö§³ÖSTNºÍTFT´øÓд¥ÃþÆÁµÄÒº¾§ÏÔʾÆÁ)¡¢SDRAM¡¢´¥ÃþÆÁ¡¢USB¡¢SPI¡¢SDºÍMMCµÈ¿ØÖÆÆ÷£¬4¸ö¾ßÓÐPWM¹¦ÄܵļÆʱÆ÷ºÍ1¸öÄÚ²¿Ê±ÖÓ£¬8ͨµÀµÄ10λADC£¬117λͨÓÃI/O¿ÚºÍ24λÍⲿÖжÏÔ´£¬8ͨµÀ10λAD¿ØÖÆÆ÷£¬´¦ÀíÆ÷¹¤×÷ƵÂÊ×î¸ß´ïµ½203MH ......
1. ls£ºÁгöÎļþÁбí
¸ñʽ£º ls option£¬option¿ÉÒÔÊÇ£º -a ÁгöÒþ²ØÎļþ£¬-l ÁгöÎļþÏêϸÐÅÏ¢
2. pwd£º²é¿´µ±Ç°Ä¿Â¼
3. mkdir£º ´´½¨Ä¿Â¼
4. touch£º ´´½¨Îļþ
5. cd£º Çл»Ä¿Â¼
6. cp£º ¿½±´Îļþ/Ŀ¼
¸ñʽ£º cp srcfile desfi ......
À´Ô´£º»ªÇåÔ¶¼ûǶÈëʽѧԺ
ºìñ¹«Ë¾´óÖлªÇøÅàѵ·þÎñ×ܼà»Æ½¨Ò«Ó뻪ÇåÔ¶¼û½ÌÓý¼¯ÍÅ×ܲü¾¾Ã·å¹²Í¬ÇìºØºÏ×÷³É¹¦
2010Äê5ÔÂ18ÈÕ£¬»ªÇåÔ¶¼û½ÌÓý¼¯ÍÅÓëºìñ´óÖлªÇø¹ØÓÚLinux¿ª·¢È˲ÅÅàÑøµÄºÏ×÷Ç©Ô¼ÒÇʽÔÚ±±¾©ÊÀ¼Í²Æ¸»ÖÐÐĺìñ¹«Ë¾×ܲ¿Õýʽ¾ÙÐУ¬ºìñ´óÖлªÇøÅàѵ·þÎñ×ܼà»Æ½¨Ò«¡¢»ªÇåÔ¶¼û½ ......
LINUX--ÐÞ¸ÄIPµØÖ·
A¡¢ÐÞ¸ÄipµØÖ·
¼´Ê±ÉúЧ:
# ifconfig eth0 192.168.0.20 netmask 255.255.255.0
Æô¶¯ÉúЧ:
ÐÞ¸Ä/etc/sysconfig/network-scripts/ifcfg-eth0
B¡¢ÐÞ¸Ädefault gateway
¼´Ê±ÉúЧ:
# route add default gw 192.168.0.254
Æô¶¯ÉúЧ:
ÐÞ¸Ä/etc/sysconfig/network-scripts/ifcfg-eth0
C¡¢ÐÞ¸Ädns
ÐÞ ......
ÏÂÔØÈñ½ÝÉÏÍø°ü,½âѹ,ÓÐĿ¼: libpcap.so.0.6.2, libstdc++.so.5,compat-libstdc%2B%2B-33_3.2.3-48_i386.deb,xrgsu
1½øÈëruijieĿ¼
sudo cd ./ruijie(½«¸ÃÎļþ¼Ð·ÅÔÚµ±Ç°Óû§Ä¿Â¼ÏÂ)
2¸´ÖÆÎļþ
sudo cp xrgsu /bin
sudo cp libpcap.so.0.6.2 /usr/lib
sudo cp libstdc++.so.5 /usr/lib
find /usr/lib -name " ......