ODBC를 테스트하기 위해 asterisk/main
디렉토리에 test.c를 추가했습니다. 불행히도 make
을 실행하면 아래와 같이 표시됩니다. 별표 : 'SQLAllocHandle'에 대한 정의되지 않은 참조
#include "asterisk/res_odbc.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
int test_function(void){
int res;
SQLHANDLE output_handle;
res = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &output_handle);
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
ast_log(LOG_DEBUG, "AllocHandle Success!\n");
} else {
ast_log(LOG_WARNING, "Error AllocHandle");
}
return 0;
}
가 어떻게이 문제를 해결할 수 있습니다 :이 같은
test.o: In function `test_function':
/usr/src/asterisk-certified-13.8-cert3/main/libtest.c:10:
undefined reference to `SQLAllocHandle'
test.c
? 감사!
참고 :'res_odbc'은''''등을 포함'' –
그것은 링커 오류이므로 코드와 .H 파일이 전혀 관련이 없습니다. odbc 라이브러리를 링크하는 것을 잊었습니다. –
odbc 라이브러리를 연결하는 방법? 헤더 파일을 포함시켜야한다고 생각했습니다. –