C?????б??????????????
???????????? ???????[ 2013/2/25 10:10:24 ] ????????
????1??/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function `_start':
????(.text+0x18):undefined reference to `main'
????collect2: ld ???? 1
????Reason: no main function in source file
????2??to get compile options -I and -l
????pkg-config lib
????e.g: pkg-config --cflags --libs dbus-1 glib-2.0 dbus-glib-1
????gcc -o send-sms send-sms.c `pkg-config --cflags --libs dbus-1 glib-2.0 dbus-glib-1`
????3???????pkg-config??????д???
?????????????????libxxx.pc.in?????л?????????????????????????Щ?????????????????????????????????????????????????????仰?????????????????????????
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: library name
Description: description goes here
Requires: glib-2.0 gobject-2.0
Version: 0.1
Libs: -L${libdir} -llibrary_name
Cflags: -I${includedir}/some_sub_dir
??????????????????????????????????pkg-config???????????
????4??forward declaration and incomplete type
??????????????????????????????????????????????????????????????????????????δ?ж??塣??????????????????????????
#ifndef __POINT_H
#define__POINT_H
typedef struct _Point Point;
#endif
????????????????????????????????Point?????:
????1????????????????????????void print_point(Point p)??????????????????????????庯??
????2?????????Point *p;
??????????????Point??????????
????1???綨???????Point p;
????2?????庯??????βΣ?void print_point(Point p) { ... }
????3?????????????????????????Point *point = (Point *) calloc(1?? sizeof(Point));
????????incomplete type????????????????????Notification?????????С???????????????????????в???и??????????壬?????????????????????????????棬????????????
????C++????????????Ч???Forward declaration????????????????????????????????????????????ж??????
class Point;
Point a;
???????Foward declaration????????????????????????????????????
??????
![](/images/ad-banner/ad-banner.png)
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11