도와주세요ㅜㅜ 고수님들.

jinchanggyu의 이미지

[root@localhost kangwon]# gcc -o abctest test.c -I/usr/local/include/mysql -L/usr/local/lib/mysql -lmysqlclient
test.c: In function ‘fetchfieldbyID’:
test.c:74: warning: incompatible implicit declaration of built-in function ‘strncpy’
test.c: In function ‘fetchfieldbyName’:
test.c:98: warning: incompatible implicit declaration of built-in function ‘strncpy’
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status

왜 이런거에요? 어떻게 해야하나요?

danskesb의 이미지

http://stackoverflow.com/questions/977233/warning-incompatible-implicit-declaration-of-built-in-function-xyz

"warning: incompatible implicit declaration of built-in function ‘strncpy’" 이건 구글에 검색하면 맨 처음으로 저게 뜨고, "/usr/bin/ld: cannot find -lmysqlclient"는 MySQL 클라이언트 라이브러리가 없다는 건데, 실제 MySQL이 저 경로에 설치된 건가요? /usr/local로 미루어 보아 컴파일해서 설치한 것 같은데.

drinkme의 이미지

gcc -o abctest test.c `pkg-config --cflags --libs mysqlclient`