windows上面写的C在linux上面编译报错
我在windows上面写了个C程序,生成的exe是好使得,没啥问题。
但是这个程序要求在linux上面也能使用,于是我把程序直接ftp到了linux上面。
用gcc编译,如下:
[unionmon@bss-wg4 ~]$ cd filter/
[unionmon@bss-wg4 filter]$ ll
总计 152
drwxr-xr-x 2 unionmon unionmon 4096 03-10 09:52 Debug
-rw-r--r-- 1 unionmon unionmon 6756 03-10 09:56 filter.c
-rw-r--r-- 1 unionmon unionmon 3335 03-10 09:52 filter.dsp
-rw-r--r-- 1 unionmon unionmon 518 03-10 09:52 filter.dsw
-rw-r--r-- 1 unionmon unionmon 66560 03-10 09:52 filter.ncb
-rw-r--r-- 1 unionmon unionmon 48640 03-10 09:52 filter.opt
-rw-r--r-- 1 unionmon unionmon 646 03-10 09:52 filter.plg
-rw-r--r-- 1 unionmon unionmon 3232 03-10 09:52 Makefile
drwxr-xr-x 2 unionmon unionmon 4096 03-10 09:52 PCRE
[unionmon@bss-wg4 filter]$ gcc -o filter filter.c
/tmp/ccQanRQY.o: In function `match':
filter.c:(.text+0x86e): undefined reference to `pcre_compile'
filter.c:(.text+0x8bc): undefined reference to `pcre_exec'
collect2: ld 返回 1
[unionmon@bss-wg4 filter]$