http://www.hackerschool.org/HS_Boards/zboard.php?desc=desc&no=308 [º¹»ç]
[indra@indra test]$ ls -al
total 12
drwxr-xr-x 2 indra member 4096 Oct 17 00:12 .
drwxr-xr-x 4 indra member 4096 Oct 17 00:08 ..
-rw-r--r-- 1 indra member 1230 Oct 17 00:08 mysql.c
[indra@indra test]$ gcc -o mysql mysql.c
mysql.c:9:25: mysql/mysql.h: No such file or directory
[indra@indra test]$ gcc -o mysql mysql.c -I/usr/local/mysql/include
/tmp/cccV70Gq.o: In function `main':
/tmp/cccV70Gq.o(.text+0x45): undefined reference to `mysql_init'
/tmp/cccV70Gq.o(.text+0x64): undefined reference to `mysql_real_connect'
/tmp/cccV70Gq.o(.text+0x92): undefined reference to `mysql_query'
/tmp/cccV70Gq.o(.text+0xa2): undefined reference to `mysql_error'
/tmp/cccV70Gq.o(.text+0xb7): undefined reference to `mysql_close'
/tmp/cccV70Gq.o(.text+0xcc): undefined reference to `mysql_store_result'
/tmp/cccV70Gq.o(.text+0xfc): undefined reference to `mysql_fetch_row'
/tmp/cccV70Gq.o(.text+0x10c): undefined reference to `mysql_close'
collect2: ld returned 1 exit status
[indra@indra test]$ gcc -o mysql mysql.c -I/usr/local/mysql/include -lmysqlclient -L/usr/local/mysql/lib/mysql
[indra@indra test]$ ls -al mysql
-rwxr-xr-x 1 indra member 15278 Oct 17 00:13 mysql
[indra@indra test]$ rm -rf mysql
[indra@indra test]$ alias mysqlgcc='gcc -I/usr/local/mysql/include -lmysqlclient -L/usr/local/mysql/lib/mysql'
[indra@indra test]$ mysqlgcc -o mysql mysql.c
[indra@indra test]$ ls -al mysql
-rwxr-xr-x 1 indra member 15278 Oct 17 00:14 mysql
[indra@indra test]$ ./mysql
MySQL Password:
Connection failed.
[indra@indra test]$
>¾Æ·¡ÂÊ¿¡ aliasÁú¹®À» Çߴµ¥...
>¹®Á¦´Â
>gcc ¼Ò½ºÆÄÀϸí [¿É¼Ç]
>À¸·Î ÇؾßÁö,
>
>gcc [¿É¼Ç] ¼Ò½ºÆÄÀϸí
>
>À¸·Î ÇÏ¸é ¿É¼ÇÀÌ ÀνÄÀÌ ¾ÈµÇ³»¿ä.
>±×·±µ¥, alias·Î ¼³Á¤ÇÏ¸é ¼Ò½º ÆÄÀÏ¿µ µÚ¿¡ ¿É¼ÇÀ» ºÙÀÌ´Â ¹æ¹ýÀ» ¸ð¸£°Ú½À´Ï´Ù..
>¾î¶² º¯¼ö °°Àº °ÍÀÌ¶óµµ ¾µ¼öÀִ°ÍÀÎÁö...
>¾Æ·¡ÂÊÁú¹®¿¡¼ make¸¦ ¹è¿öº¸¶ó°í ÇÏ´Â ºÐÀÌ °è¼Ì´Âµ¥ ±×°Ô ³ªÀº°ÍÀÎÁö.. ÄÄÆÄÀÏ&¸µÅ·À» ÇѲ¨¹ø¿¡ ÇÑ´Â °Íº¸´Ù... Àú´Â ÆÄÀÏÀ» °³º°ÀûÀ¸·Î ÇÏ´Â °æ¿ì°¡ ¸¹¾Æ¼.. ¿ÕÃʺ¸¶ó À̸®Àú¸® Çغ¸´ÂÁö¶ó...
|
Hit : 3281 Date : 2003/10/17 01:16
|