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

Linux GCC makeÎļþµÄд·¨3

 °üº¬3¸öÎļþ¼Ð
Ŀ¼×éÖ¯½á¹¹ÈçÏ£º
inc/hello.h
main/main.c, Makefile
src/hello.c
ÎļþÄÚÈÝÈçÏ£º
hello.h:
void hello(char name[]);
main.c:
#include <stdio.h>
#include "../inc/hello.h"
// The second hello.h should in ""
int main()
{
hello("GCC");
printf("Haha Linux Ubuntu!\n");
return 0;
}
ÆäÖУ¬µÚ¶þ¸ö°üº¬Îļþ£¬hello.h£¬±ØÐëÒªÓÃ""£¬Èç¹ûÓÃ<>ÔògccÖ»»áµ½ÏµÍ³Ä¿Â¼ÏÂÈ¥ËÑË÷£¬²»»áµ½±¾µ±Ç°Ä¿Â¼ÏÂËÑË÷
¾ÍÊÇ""ÔÚÓû§Ä¿Â¼Ï£¬<>ÔÚϵͳĿ¼Ï£¬Õâ¸öÔÚwindowsÉϲ»Ñϸñ£¬ ÔÚlinuxÀïËƺõºÜÑϸñ
Makefile°æ±¾1:
# String declaration
objects = main.o hello.o
# Command
app : $(objects)
cc -o app $(objects)
main.o : main.c hello.h
cc -c main.c
hello.o : hello.c stdio.h
cc -c ../src/hello.c
# Search paths
vpath %.h /usr/include ../inc
vpath %.c ../src
# Clean the intermediate files
.PHONY : clean
clean :
rm app $(objects)
òËÆvpathÖ»¶Ô %.o : ºóÃæµÄÓÐÓ°Ï죬ÏÂÃæµÄcc -cûÓÐ×÷ÓÃ
**************************
ȷʵÊÇÕâÑùµÄ£¬
%.o : %.c %.h£¬Õâ¾ä»°ÊÇmakeµÄÓï¾ä£¬¶øÏÂÃæµÄ
cc -c %.c£¬Õâ¾ä»°ÊÇgccµÄÓï¾ä£¬
¶øvpathºÍVPATHÉ趨µÄÊÇmakeµÄËÑË÷·¾¶£¬¶ÔgccµÄËÑË÷·¾¶Ã»ÓÐÓ°Ïì¡£
gccÉèÖÃËÑË÷·¾¶Îª£º
cc -c main.c -Iinclude
**************************
Makefile°æ±¾2£º
# String declaration
objects = main.o hello.o
# Command
app : $(objects)
cc -o app $(objects)
main.o : main.c hello.h
cc -c main.c
hello.o : ../src/hello.c stdio.h
cc -c ../src/hello.c
# Search paths
vpath %.h /usr/include ../inc
#vpath %.c ../src
# Clean the intermediate files
.PHONY : clean
clean :
rm app $(objects)

hello.c:
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}


Ïà¹ØÎĵµ£º

ubuntu Ô¶³ÌÁ¬½Ó linux ʹÓÃSSH (ubuntu ÅäÖÃssh·þÎñ)

°²×°OpenSSH
UbuntuȱʡûÓа²×°SSH Server£¬Ê¹ÓÃÒÔÏÂÃüÁî°²×°£º
sudo apt-get install openssh-server openssh-client
²»¹ýUbuntuȱʡÒѾ­°²×°ÁËssh client¡£
ÅäÖÃÍê³ÉºóÖØÆð£º
sudo /etc/init.d/ssh restart
windows ¿Í»§¶ËÓÃputtyÁ¬½ÓÃüÁîshellģʽ
......

Ò»¸öLinuxÏÂCÏ̳߳صÄʵÏÖ

      ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØҪʹÓÃÏ̳߳ØÁË¡£
   ÏÂÃæÊÇ ......

Linux¾²Ì¬/¶¯Ì¬Á´½Ó¿âµÄ´´½¨ºÍʹÓÃ


ºÍ
WindowsϵͳһÑùLinuxÒ²Óо²Ì¬/¶¯Ì¬Á´½Ó¿â£¬ÏÂÃæ½éÉÜ´´½¨ºÍʹÓ÷½·¨£º
¼ÙÉèÓÐÏÂÃ漸¸öÎļþ£º
Í·ÎļþString.h£¬ÉùÃ÷Ïà¹Øº¯ÊýÔ­ÐΣ¬ÄÚÈÝÈçÏ£º
Strlen.c£º
º¯ÊýStrlenµÄʵÏÖ£¬»ñÈ¡¸ø¶¨×Ö·û´®µÄ³¤¶È£¬ÄÚÈÝÈçÏ£º
Strlnen.c£ºº¯Êý
StrNlenµÄʵÏÖ£¬»ñÈ¡¸ø¶¨×Ö·û´®µÄ³¤¶È£¬Èç¹ûÊäÈë×Ö·û´®µÄ³¤¶È´óÓÚÖ¸¶¨µÄ×î´ó³¤¶È£¬Ô ......

ÔÚlinuxϱȽϺÃÓõÄchmÔĶÁÆ÷ºÍ·ÉÐÅÈí¼þ

1¡¢ÔÚlinux϶Á΢Èí±ê×¼µÄchmÎļþʱ£¬ÕÒÁ˺þÃÖÕÓÚÕÒÁËÒ»¿îºÜ²»´íµÄÈí¼þ£­£­£­KchmViewer
¿ÉÒÔͨ¹ýÖն˰²×°£º
sudo apt-get install kchmViewer
ʹÓÃubuntuµÄÅóÓÑÒ²¿ÉÒÔÔÚubuntuÈí¼þÖÐÐÄ°²×°¡£
2¡¢LibeFetion·Ç³£ºÃµÄµÚÈý·½Ãâ·Ñ·ÉÐÅÈí¼þ£¬Ò²ÓÐwindows°æ±¾
¹ÙÍøÖ÷Ò³£ºhttp://www.libfetion.org/index.php
ÕæµÄ·Ç³£ºÃÓà ......

Linux GCC makeÎļþµÄд·¨2

ÎļþÔÚÁ½¸öÎļþ¼Ð£º
inc/hello.h
main/hello.c, main.c, Makefile
ÎļþÄÚÈÝ£º
hello.h
void hello(char name[]);

hello.c
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}

main.c
#include <stdio.h>
#include "../inc/hello.h"
// The second
int main( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ