라이브러리 링크는 잘 하셨는데요
소스코드에 다음과 같은 헤더파일을 including 해주어야 합니다.
소스코드에 다음을 첨가해 보세요.
#include <lber.h>
이 라인을 첨가하고
라이브러리를 링크시켜 컴파일하면 에러메세지가 사라집니다.
참고로 netscape SDK인 경우는 lber.h를 include하지 않아도 문제가 없지만
University of Michigan SDK를 사용하시는 경우에는 반드시 include해주어야 합니다.
>>오세범 님께서 쓰시길<<
:: $ gcc just_bind.c -o just_bind -lldap -llber
:: In file included from just_bind.c:2:
:: /usr/local/include/ldap.h:302: parse error before `BerElement'
:: /usr/local/include/ldap.h:302: warning: no semicolon at end of struct or union
:: /usr/local/include/ldap.h:306: parse error before `}'
:: /usr/local/include/ldap.h:306: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:371: parse error before `LDAPMessage'
:: /usr/local/include/ldap.h:371: warning: no semicolon at end of struct or union
:: /usr/local/include/ldap.h:372: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:380: parse error before `}'
:: /usr/local/include/ldap.h:380: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:424: parse error before `Sockbuf'
:: /usr/local/include/ldap.h:424: warning: no semicolon at end of struct or union
:: /usr/local/include/ldap.h:450: parse error before `*'
:: /usr/local/include/ldap.h:450: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:452: parse error before `*'
:: /usr/local/include/ldap.h:452: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:455: parse error before `*'
:: /usr/local/include/ldap.h:455: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:470: parse error before `ld_lber_encode_translate_proc'
:: /usr/local/include/ldap.h:470: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:471: parse error before `ld_lber_decode_translate_proc'
:: /usr/local/include/ldap.h:471: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:480: warning: data definition has no type or storage class
:: /usr/local/include/ldap.h:524: parse error before `*'
::
:: <중간생략>
::
:: /usr/local/include/ldap.h:735: parse error before `*'
:: /usr/local/include/ldap.h:736: parse error before `)'
:: /usr/local/include/ldap.h:746: parse error before `*'
:: /usr/local/include/ldap.h:747: parse error before `*'
:: /usr/local/include/ldap.h:749: parse error before `*'
:: /usr/local/include/ldap.h:756: parse error before `*'
:: /usr/local/include/ldap.h:758: parse error before `*'
:: /usr/local/include/ldap.h:760: parse error before `*'
:: /usr/local/include/ldap.h:762: parse error before `*'
:: just_bind.c: In function `main':
:: just_bind.c:7: `ld' undeclared (first use in this function)
:: just_bind.c:7: (Each undeclared identifier is reported only once
:: just_bind.c:7: for each function it appears in.)
:: just_bind.c:8: parse error before `char'
:: just_bind.c:17: `User' undeclared (first use in this function)
:: just_bind.c:17: `Passwd' undeclared (first use in this function)
:: just_bind.c:6: warning: return type of `main' is not `int'
:: $
:: 위와 같이 나옵니다... 아무래도 라이브러리가 링크가 제대로 않돼는것 같은데..
:: 어케 해야할런지 알려주세염...
|