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

Linux GCC makeÎļþµÄд·¨4 ÇåÎú°æ

°üº¬3¸öÎļþ¼Ð£¬ºÍÒ»¸öÎļþMakefile
Ŀ¼×éÖ¯½á¹¹ÈçÏ£º
Makefile
inc/hello.h
main/main.c
src/hello.c
MakefileÎļþÔÚÍâÃ棬ÕâÑùÉú³ÉµÄ.oºÍ¿ÉÖ´ÐÐÎļþ¶¼ÔÚÍâÃ棬cleanÖ®ºó»áºÜ¸É¾»£¬½á¹¹ÇåÎú
ÎļþÄÚÈÝÈçÏ£º
Makefile(Ö®ËùÒÔÓôóд£¬ÒòΪmake¿ÉÒÔʶ±ðMakefileºÍmakefile£¬Óôóд¿ÉÒÔÏÊÃ÷һЩ)::
# String declaration
objects = main.o hello.o
# Command
app : $(objects)
cc -o app $(objects)
main.o : main/main.c hello.h
cc -c main/main.c
hello.o : src/hello.c stdio.h
cc -c src/hello.c
# Search paths
vpath %.h /usr/include inc
# Clean the intermediate files
.PHONY : clean
clean :
rm app $(objects)

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ÀïËƺõºÜÑϸñ
hello.c:
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}


Ïà¹ØÎĵµ£º

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


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

ÐéÄâ»úÉÏSourceInsight·ÃÎÊLinuxϵͳµÄ´úÂë


Ê×ÏÈÔÚLinuxϵͳÉÏ°²×°samba
È»ºóÆô¶¯WindowsÐéÄâ»ú£¬ÔÚ×ÊÔ´¹ÜÀíÆ÷Öн«sambaµÄµØÖ·£¨ÀýÈç//192.168.1.10/share£©Ó³ÉäΪһ¸öÐéÄâÅÌ·ûZ
×îºóÆô¶¯SourceInsight£¬ÔÚZÅÌÉϽ¨Á¢¹¤³Ì£¬²¢µ¼ÈëÎļþ¡£
×¢Ò⣺ÒÔºóÿ´ÎʹÓÃSourceInsight֮ǰÏÈÒªÁ¬½Ósamba·þÎñÆ÷£¬±ÈÈç˵´ò¿ªÅÌ·ûZ¡£ ......

linux¶¨Ê±Æ÷ÉèÖÃ

10.5.2 ¾«Í¨¶¨Ê±Æ÷ÉèÖÃ
º¯ÊýalarmÉèÖõĶ¨Ê±Æ÷Ö»Äܾ«È·µ½Ã룬¶øÒÔϺ¯ÊýÀíÂÛÉÏ¿ÉÒÔ¾«È·µ½Î¢Ã
#include  <sys/select.h>
#include  <sys/itimer.h>
int getitimer(int which, struct itimerval *value);
int setitimer(int which, const struct itimerval
*value, struct itimerval *ovalue ......

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

ËùÐèÎļþhello.c, main.c, hello.h, Makefile£¬ÔÚͬһ¸öĿ¼ÏÂ
hello.c:
#include <stdio.h>
void hello(char name[])
{
printf("Hello %s!\n", name);
}

main.c:
#include "stdio.h"
#include "hello.h"
// The second
int main()
{
hello("GCC");
printf("Haha Linux Ubuntu!\n");
......

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 Ub ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ