[도움요청] AIX에서 DB2용 C언어 샘플 컴파일 오류...
아래쪽에 질문을 드렸었는데...
다행히도 샘플을 찾을수 있었습니다. ^^;;;
AIX C 언어로 DB2 에 접속한후... 단순히 INSERT 만을 하려고 하는데...
상당히 어렵네요...
VC++ 에서 처럼 몇개의 라인으로 쉽게 해결될줄 알았는데...
좌절 좌절입니다. ㅡㅡ;;;
현재 sample/c 폴더안에 있는 c 프로그램을 cc 로 컴파일 하면...
오류만 잔뜩 떨어집니다.
이거 어디부터 손대야 하죠???
오늘안에 해결해야 하는데...
좋은 방법 없을까요??? ㅠ.ㅠ
무작위로 한개의 소스를 컴파일 해봤습니다.
오류 사항들이 OTL 이네요... ㅠ.ㅠ
#include [sqlutil.h] <<--- 꺽쇠를 하면 안보여서 대괄호로 변경했습니다.
인클루드부터 오류가 나버리니... 참.. 난감합니다.
경로를 어찌 설정해줘야 하는것인지... 에효... ㅠ.ㅠ
불쌍히 여기셔서 좋은 조언 부탁 드립니다. ㅠ.ㅠ
---------------------------------------------------------------------------------------
$ cc ininfo.c
cc: 1501-220 current directory is not writable
"ininfo.c", line 67.10: 1506-296 (S) #include file [sqlutil.h] not found.
"ininfo.c", line 68.10: 1506-296 (S) #include file [db2ApiDf.h] not found.
"ininfo.c", line 69.10: 1506-296 (S) #include file [sqlenv.h] not found.
"ininfo.c", line 81.5: 1506-282 (S) The type of the parameters must be specified in a prototype.
"ininfo.c", line 82.5: 1506-282 (S) The type of the parameters must be specified in a prototype.
"ininfo.c", line 87.17: 1506-045 (S) Undeclared identifier SQL_INSTNAME_SZ.
"ininfo.c", line 87.17: 1506-195 (S) Integral constant expression with a value greater than zero is required.
"ininfo.c", line 90.15: 1506-277 (S) Syntax error: possible missing ';' or ','?
"ininfo.c", line 90.3: 1506-045 (S) Undeclared identifier db2CfgParam.
"ininfo.c", line 91.3: 1506-045 (S) Undeclared identifier db2Cfg.
"ininfo.c", line 94.3: 1506-045 (S) Undeclared identifier cfgStruct.
"ininfo.c", line 95.26: 1506-045 (S) Undeclared identifier cfgParameters.
"ininfo.c", line 96.21: 1506-045 (S) Undeclared identifier db2CfgDatabaseManager.
"ininfo.c", line 96.45: 1506-045 (S) Undeclared identifier db2CfgDelayed.
"ininfo.c", line 154.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 155.33: 1506-045 (S) Undeclared identifier SQL_INSTNAME_SZ.
"ininfo.c", line 155.33: 1506-195 (S) Integral constant expression with a value greater than zero is required.
"ininfo.c", line 174.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 175.10: 1506-007 (S) "struct sqle_node_struct" is undefined.
"ininfo.c", line 176.10: 1506-007 (S) "struct sqle_node_tcpip" is undefined.
"ininfo.c", line 189.40: 1506-045 (S) Undeclared identifier SQL_NNAME_SZ.
"ininfo.c", line 190.55: 1506-045 (S) Undeclared identifier SQL_CMT_SZ.
"ininfo.c", line 191.23: 1506-045 (S) Undeclared identifier SQL_NODE_STR_ID.
"ininfo.c", line 192.22: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_TCPIP.
"ininfo.c", line 194.47: 1506-045 (S) Undeclared identifier SQL_HOSTNAME_SZ.
"ininfo.c", line 196.11: 1506-045 (S) Undeclared identifier SQL_SERVICE_NAME_SZ.
"ininfo.c", line 226.51: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 227.50: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 228.50: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 229.50: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 231.13: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 233.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_APPC.
"ininfo.c", line 233.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 236.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_APPN.
"ininfo.c", line 236.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 239.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_CPIC.
"ininfo.c", line 239.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 242.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_IPXSPX.
"ininfo.c", line 242.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 245.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_LOCAL.
"ininfo.c", line 245.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 248.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_NETB.
"ininfo.c", line 248.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 251.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_NPIPE.
"ininfo.c", line 251.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 254.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_SOCKS.
"ininfo.c", line 254.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 257.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_SOCKS4.
"ininfo.c", line 257.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 260.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 263.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_TCPIP4.
"ininfo.c", line 263.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 266.12: 1506-045 (S) Undeclared identifier SQL_PROTOCOL_TCPIP6.
"ininfo.c", line 266.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 290.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 291.26: 1506-275 (S) Unexpected text dbDirOpenParmStruct encountered.
"ininfo.c", line 291.3: 1506-045 (S) Undeclared identifier db2DbDirOpenScanStruct.
"ininfo.c", line 292.27: 1506-275 (S) Unexpected text dbDirCloseParmStruct encountered.
"ininfo.c", line 292.3: 1506-045 (S) Undeclared identifier db2DbDirCloseScanStruct.
"ininfo.c", line 293.10: 1506-007 (S) "struct db2DbDirNextEntryStructV9" is undefined.
"ininfo.c", line 297.26: 1506-045 (S) Undeclared identifier SQL_REMOTE.
"ininfo.c", line 301.13: 1506-277 (S) Syntax error: possible missing ';' or ','?
"ininfo.c", line 301.3: 1506-045 (S) Undeclared identifier db2Uint16.
"ininfo.c", line 303.13: 1506-277 (S) Syntax error: possible missing ';' or ','?
"ininfo.c", line 306.13: 1506-277 (S) Syntax error: possible missing ';' or ','?
"ininfo.c", line 306.3: 1506-045 (S) Undeclared identifier db2Uint32.
"ininfo.c", line 334.12: 1506-045 (S) Undeclared identifier dbAuthentication.
"ininfo.c", line 348.3: 1506-045 (S) Undeclared identifier dbDirOpenParmStruct.
"ininfo.c", line 349.33: 1506-045 (S) Undeclared identifier dbDirHandle.
"ininfo.c", line 350.20: 1506-045 (S) Undeclared identifier versionNumber.
"ininfo.c", line 360.8: 1506-045 (S) Undeclared identifier dbEntryNb.
"ininfo.c", line 372.51: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 373.49: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 377.51: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 379.49: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 380.49: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 381.50: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 382.50: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 384.13: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 386.12: 1506-045 (S) Undeclared identifier SQL_INDIRECT.
"ininfo.c", line 386.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 389.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 392.12: 1506-045 (S) Undeclared identifier SQL_HOME.
"ininfo.c", line 392.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 395.12: 1506-045 (S) Undeclared identifier SQL_DCE.
"ininfo.c", line 395.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 402.13: 1506-285 (S) The indirection operator cannot be applied to a pointer to an incomplete struct or union.
"ininfo.c", line 404.12: 1506-045 (S) Undeclared identifier SQL_AUTHENTICATION_SERVER.
"ininfo.c", line 404.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 407.12: 1506-045 (S) Undeclared identifier SQL_AUTHENTICATION_CLIENT.
"ininfo.c", line 407.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 410.12: 1506-045 (S) Undeclared identifier SQL_AUTHENTICATION_DCS.
"ininfo.c", line 410.12: 1506-051 (S) Case expression must be a valid integral constant.
"ininfo.c", line 427.3: 1506-045 (S) Undeclared identifier dbDirCloseParmStruct.
"ininfo.c", line 445.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 446.10: 1506-007 (S) "struct sql_dir_entry" is undefined.
"ininfo.c", line 447.10: 1506-007 (S) "struct sql_dir_entry" is undefined.
"ininfo.c", line 466.29: 1506-045 (S) Undeclared identifier SQL_DCS_STR_ID.
"ininfo.c", line 510.39: 1506-043 (S) The operand of the sizeof operator is not valid.
"ininfo.c", line 522.14: 1506-486 (S) A pointer to an incomplete type cannot be indexed.
"ininfo.c", line 524.14: 1506-486 (S) A pointer to an incomplete type cannot be indexed.
"ininfo.c", line 526.14: 1506-486 (S) A pointer to an incomplete type cannot be indexed.
"ininfo.c", line 528.14: 1506-486 (S) A pointer to an incomplete type cannot be indexed.
"ininfo.c", line 530.14: 1506-486 (S) A pointer to an incomplete type cannot be indexed.
"ininfo.c", line 532.14: 1506-486 (S) A pointer to an incomplete type cannot be indexed.
"ininfo.c", line 559.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 560.15: 1506-277 (S) Syntax error: possible missing ';' or ','?
"ininfo.c", line 560.3: 1506-045 (S) Undeclared identifier db2CfgParam.
"ininfo.c", line 561.3: 1506-045 (S) Undeclared identifier db2Cfg.
"ininfo.c", line 570.3: 1506-045 (S) Undeclared identifier cfgParameters.
"ininfo.c", line 571.28: 1506-045 (S) Undeclared identifier SQLF_KTN_DFT_ACCOUNT_STR.
"ininfo.c", line 573.36: 1506-045 (S) Undeclared identifier SQL_ACCOUNT_STR_SZ.
"ininfo.c", line 575.28: 1506-045 (S) Undeclared identifier SQLF_KTN_UDF_MEM_SZ.
"ininfo.c", line 588.3: 1506-045 (S) Undeclared identifier cfgStruct.
"ininfo.c", line 590.21: 1506-045 (S) Undeclared identifier db2CfgDatabaseManager.
"ininfo.c", line 590.45: 1506-045 (S) Undeclared identifier db2CfgDelayed.
"ininfo.c", line 594.13: 1506-045 (S) Undeclared identifier db2Version900.
"ininfo.c", line 620.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 621.15: 1506-277 (S) Syntax error: possible missing ';' or ','?
"ininfo.c", line 621.3: 1506-045 (S) Undeclared identifier db2CfgParam.
"ininfo.c", line 622.3: 1506-045 (S) Undeclared identifier db2Cfg.
"ininfo.c", line 632.3: 1506-045 (S) Undeclared identifier cfgParameters.
"ininfo.c", line 633.28: 1506-045 (S) Undeclared identifier SQLF_KTN_DFT_ACCOUNT_STR.
"ininfo.c", line 635.36: 1506-045 (S) Undeclared identifier SQL_ACCOUNT_STR_SZ.
"ininfo.c", line 637.28: 1506-045 (S) Undeclared identifier SQLF_KTN_UDF_MEM_SZ.
"ininfo.c", line 645.3: 1506-045 (S) Undeclared identifier cfgStruct.
"ininfo.c", line 647.21: 1506-045 (S) Undeclared identifier db2CfgDatabaseManager.
"ininfo.c", line 647.45: 1506-045 (S) Undeclared identifier db2CfgGetDefaults.
"ininfo.c", line 653.13: 1506-045 (S) Undeclared identifier db2Version900.
"ininfo.c", line 686.47: 1506-045 (S) Undeclared identifier db2CfgReset.
"ininfo.c", line 686.61: 1506-045 (S) Undeclared identifier db2CfgDelayed.
"ininfo.c", line 706.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 707.12: 1506-275 (S) Unexpected text runTimeDegree encountered.
"ininfo.c", line 707.3: 1506-045 (S) Undeclared identifier sqlint32.
"ininfo.c", line 715.3: 1506-045 (S) Undeclared identifier runTimeDegree.
"ininfo.c", line 719.12: 1506-045 (S) Undeclared identifier SQL_ALL_USERS.
"ininfo.c", line 725.39: 1506-275 (S) Unexpected text cfgStruct encountered.
"ininfo.c", line 727.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 730.3: 1506-045 (S) Undeclared identifier cfgStruct.
"ininfo.c", line 731.35: 1506-045 (S) Undeclared identifier SQLF_KTN_DFT_ACCOUNT_STR.
"ininfo.c", line 733.36: 1506-045 (S) Undeclared identifier SQL_ACCOUNT_STR_SZ.
"ininfo.c", line 735.35: 1506-045 (S) Undeclared identifier SQLF_KTN_UDF_MEM_SZ.
"ininfo.c", line 746.13: 1506-045 (S) Undeclared identifier db2Version900.
"ininfo.c", line 752.42: 1506-275 (S) Unexpected text cfgStruct encountered.
"ininfo.c", line 754.10: 1506-007 (S) "struct sqlca" is undefined.
"ininfo.c", line 759.37: 1506-045 (S) Undeclared identifier cfgStruct.
"ininfo.c", line 759.13: 1506-045 (S) Undeclared identifier db2Version900.
-------------------------------------------------------------------------------------------------------
해답은 README 파일에
해답은 README 파일에 있습니다. 급하시더라고 조금의 여유를 갖고 주변을 보는게 필요합니다.
일단 헤더파일 경로를 주어야 합니다. 헤더 경로는 ~db2inst/sqllib/include
라이브러리 경로는 ~db2inst/sqllib/{lib32,lib64}
참고로 실행될 머신마다 bind 시킬 요량이 아니라면 CLI 방식을 추천합니다.
---------
간디가 말한 우리를 파괴시키는 7가지 요소
첫째, 노동 없는 부(富)/둘째, 양심 없는 쾌락
셋째, 인격 없는 지! 식/넷째, 윤리 없는 비지니스
이익추구를 위해서라면..
다섯째, 인성(人性)없는 과학
여섯째, 희생 없는 종교/일곱째, 신념 없는 정치
---------
간디가 말한 우리를 파괴시키는 7가지 요소
첫째, 노동 없는 부(富)/둘째, 양심 없는 쾌락
셋째, 인격 없는 지! 식/넷째, 윤리 없는 비지니스
이익추구를 위해서라면..
다섯째, 인성(人性)없는 과학
여섯째, 희생 없는 종교/일곱째, 신념 없는 정치
댓글 달기