Error while Compiling ODBC Loader Package
I was trying to using ODBC Loader package as mentioned in github at https://github.com/vertica/Vertica-Extension-Packages/tree/master/odbc_loader_package and confronted through couple of issues. At first when I tried compiling the package, it threw error saying that "StringParsers.h" is not available. Then I removed every codes associated to this parser and compiled it. It did compiled successfully then after but while creating library, I ran into error saying SQL Fetch as undefined symbol. Detail error as "Error: [Vertica][VJDBC](3399) ROLLBACK: Failure in UDx RPC call InvokeSetExecContext(): Error calling setupContext() in User Defined Object [] at [/scratch_a/release/vbuild/vertica/UDxFence/vertica-udx-C++.cpp:132], error code: 0, message: Error happened in dlopen(): [/vertica/data/UDF/ODBCLoader.so: undefined symbol: SQLFetch] SQLState: HY000 ErrorCode: 3399" Any help here will be appreciated, as I'm trying to connect to Oracle directly using ODBC.
0
Comments
/opt/vertica/sdk/examples/HelperLibraries/StringParsers.h /opt/vertica/sdk/examples/ParserFunctions/StringParsers.h
I am having the same error message with dlopen when I try to create the library after I use this command to compile the files and it works and creates .so file.
g-I /opt/vertica/sdk/include -I /usr/local/include -I /opt/vertica/sdk/examples/HelperLibraries -Wall -shared -fPIC -o ODBCLoader.so ODBCLoader.cpp /opt/vertica/sdk/include/Vertica.cpp -lodbc
If I try to use makefile to compile the code, it gives lot of errors. Here is the output
g++ -I /opt/vertica/sdk/include -I /opt/vertica/include -I /opt/vertica/sdk/examples/HelperLibraries -fPIC -shared -Wall -g -o build/ODBCLoader.so /opt/vertica/sdk/include/Vertica.cpp ODBCLoader.cpp -lodbcIn file included from ODBCLoader.cpp:5:/opt/vertica/include/sql.h:25: warning: ignoring #pragma region DesktopIn file included from /opt/vertica/include/sql.h:38, from ODBCLoader.cpp:5:/opt/vertica/include/sqltypes.h:25: warning: ignoring #pragma region Desktop/opt/vertica/include/sqltypes.h:320: warning: ignoring #pragma endregionIn file included from ODBCLoader.cpp:5:/opt/vertica/include/sql.h:911: warning: ignoring #pragma endregionIn file included from ODBCLoader.cpp:7:/opt/vertica/include/sqlext.h:25: warning: ignoring #pragma region DesktopIn file included from ODBCLoader.cpp:7:/opt/vertica/include/sqlext.h:92:1: warning: "/*" within comment/opt/vertica/include/sqlext.h:187: warning: ignoring #pragma deprecated/opt/vertica/include/sqlext.h:2178: warning: ignoring #pragma deprecated/opt/vertica/include/sqlext.h:2204: warning: ignoring #pragma deprecated/opt/vertica/include/sqlext.h:2212: warning: ignoring #pragma warning/opt/vertica/include/sqlext.h:2213: warning: ignoring #pragma warning/opt/vertica/include/sqlext.h:2229: warning: ignoring #pragma warning/opt/vertica/include/sqlext.h:2244: warning: ignoring #pragma endregion/opt/vertica/include/sqltypes.h:289: error: âDWORDâ does not name a type/opt/vertica/include/sqltypes.h:290: error: âWORDâ does not name a type/opt/vertica/include/sqltypes.h:291: error: âWORDâ does not name a type/opt/vertica/include/sqltypes.h:292: error: âBYTEâ does not name a type/opt/vertica/include/sql.h:606: error: â_Out_â has not been declared/opt/vertica/include/sql.h:606: error: expected â,â or â...â before â*â token/opt/vertica/include/sql.h:608: error: â_Out_â was not declared in this scope/opt/vertica/include/sql.h:612: error: â_Out_â has not been declared/opt/vertica/include/sql.h:612: error: expected â,â or â...â before â*â token/opt/vertica/include/sql.h:616: error: â_Out_â has not been declared/opt/vertica/include/sql.h:616: error: expected â,â or â...â before â*â token/opt/vertica/include/sql.h:620: error: â_Inout_updates_opt_â has not been declared/opt/vertica/include/sql.h:620: error: expected ')' before â(â token/opt/vertica/include/sql.h:620: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:620: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:624: error: expected constructor, destructor, or type conversion before â(â token/opt/vertica/include/sql.h:649: error: â_Out_writes_bytes_opt_â has not been declared/opt/vertica/include/sql.h:649: error: expected â,â or â...â before âSQLPOINTERâ/opt/vertica/include/sql.h:656: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sql.h:656: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:664: error: â_Out_â has not been declared/opt/vertica/include/sql.h:664: error: expected â,â or â...â before â*â token/opt/vertica/include/sql.h:668: error: â_In_reads_â has not been declared/opt/vertica/include/sql.h:668: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:678: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:678: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:684: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:684: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:698: error: â_Out_writes_â has not been declared/opt/vertica/include/sql.h:698: error: expected ')' before numeric constant/opt/vertica/include/sql.h:698: error: expected â,â or â...â before numeric constant/opt/vertica/include/sql.h:698: error: expected initializer before âSQLCHARâ/opt/vertica/include/sql.h:705: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sql.h:705: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:731: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:731: error: expected ')' before â(â token/opt/vertica/include/sql.h:731: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:731: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:733: error: expected constructor, destructor, or type conversion before â(â token/opt/vertica/include/sql.h:742: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:742: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:750: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:750: error: expected ')' before â(â token/opt/vertica/include/sql.h:750: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:750: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:756: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:756: error: expected ')' before â(â token/opt/vertica/include/sql.h:756: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:756: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:760: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:760: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:768: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:768: error: expected ')' before â(â token/opt/vertica/include/sql.h:768: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:768: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:776: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:776: error: expected ')' before numeric constant/opt/vertica/include/sql.h:776: error: expected â,â or â...â before numeric constant/opt/vertica/include/sql.h:776: error: expected initializer before âSQLCHARâ/opt/vertica/include/sql.h:785: error: â_Out_writes_â has not been declared/opt/vertica/include/sql.h:785: error: expected ')' before â(â token/opt/vertica/include/sql.h:785: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:785: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:791: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:791: error: expected ')' before â(â token/opt/vertica/include/sql.h:791: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:792: error: expected initializer before âSQLUSMALLINTâ/opt/vertica/include/sql.h:794: error: expected constructor, destructor, or type conversion before â(â token/opt/vertica/include/sql.h:801: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sql.h:801: error: expected ')' before â(â token/opt/vertica/include/sql.h:801: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:801: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:803: error: expected constructor, destructor, or type conversion before â(â token/opt/vertica/include/sql.h:813: error: â_Out_â has not been declared/opt/vertica/include/sql.h:813: error: expected â,â or â...â before â*â token/opt/vertica/include/sql.h:816: error: â_Out_opt_â has not been declared/opt/vertica/include/sql.h:816: error: expected â,â or â...â before â*â token/opt/vertica/include/sql.h:821: error: â_In_reads_â has not been declared/opt/vertica/include/sql.h:821: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:826: error: â_In_reads_â has not been declared/opt/vertica/include/sql.h:826: error: expected ')' before â(â token/opt/vertica/include/sql.h:826: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:826: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:828: error: â_In_â was not declared in this scope/opt/vertica/include/sql.h:829: error: â_Out_â was not declared in this scope/opt/vertica/include/sql.h:829: error: initializer expression list treated as compound expression/opt/vertica/include/sql.h:833: error: â_In_reads_bytes_opt_â has not been declared/opt/vertica/include/sql.h:833: error: expected â,â or â...â before âSQLPOINTERâ/opt/vertica/include/sql.h:835: error: expected constructor, destructor, or type conversion before â(â token/opt/vertica/include/sql.h:844: error: â_In_reads_â has not been declared/opt/vertica/include/sql.h:844: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:851: error: â_In_reads_â has not been declared/opt/vertica/include/sql.h:851: error: expected ')' before â(â token/opt/vertica/include/sql.h:851: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:851: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:857: error: â_Inout_updates_bytes_opt_â has not been declared/opt/vertica/include/sql.h:857: error: expected â,â or â...â before âSQLPOINTERâ/opt/vertica/include/sql.h:861: error: â_In_reads_bytes_opt_â has not been declared/opt/vertica/include/sql.h:861: error: expected â,â or â...â before âSQLPOINTERâ/opt/vertica/include/sql.h:865: error: expected constructor, destructor, or type conversion before â(â token/opt/vertica/include/sql.h:874: error: â_In_reads_â has not been declared/opt/vertica/include/sql.h:874: error: expected ')' before â(â token/opt/vertica/include/sql.h:874: error: expected â,â or â...â before â(â token/opt/vertica/include/sql.h:874: error: expected initializer before âSQLPOINTERâ/opt/vertica/include/sql.h:876: error: expected constructor, destructor, or type conversion before â(â token/opt/vertica/include/sql.h:884: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sql.h:884: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:890: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sql.h:890: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sql.h:896: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sql.h:896: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:1788: error: â_In_reads_â has not been declared/opt/vertica/include/sqlext.h:1789: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:1905: error: â_In_reads_â has not been declared/opt/vertica/include/sqlext.h:1906: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:1931: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sqlext.h:1932: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:1947: error: â_Out_opt_â has not been declared/opt/vertica/include/sqlext.h:1948: error: expected â,â or â...â before â*â token/opt/vertica/include/sqlext.h:1960: error: â_Out_opt_â has not been declared/opt/vertica/include/sqlext.h:1961: error: expected â,â or â...â before â*â token/opt/vertica/include/sqlext.h:1967: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sqlext.h:1968: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:1992: error: â_In_reads_â has not been declared/opt/vertica/include/sqlext.h:1992: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:2001: error: â_Out_opt_â has not been declared/opt/vertica/include/sqlext.h:2002: error: expected â,â or â...â before â*â token/opt/vertica/include/sqlext.h:2011: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sqlext.h:2012: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:2023: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sqlext.h:2024: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:2038: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sqlext.h:2039: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:2058: error: â_In_reads_opt_â has not been declared/opt/vertica/include/sqlext.h:2059: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:2071: error: â_Out_writes_opt_â has not been declared/opt/vertica/include/sqlext.h:2072: error: expected â,â or â...â before âSQLCHARâ/opt/vertica/include/sqlext.h:2126: error: â_Out_â has not been declared/opt/vertica/include/sqlext.h:2127: error: expected â,â or â...â before â*â token/opt/vertica/include/sqlext.h:2167: error: â_In_opt_â was not declared in this scope/opt/vertica/include/sqlext.h:2168: error: âcbOutputMsgâ was not declared in this scope/opt/vertica/include/sqlext.h:2168: error: â_Out_writes_bytes_opt_â was not declared in this scope/opt/vertica/include/sqlext.h:2169: error: â_In_â was not declared in this scope/opt/vertica/include/sqlext.h:2170: error: initializer expression list treated as compound expression/opt/vertica/include/sqlext.h:2173: error: âVOIDâ does not name a type/opt/vertica/include/sqlext.h:2174: error: âDWORDâ does not name a type/opt/vertica/include/sqlext.h:2182: error: âDWORDâ was not declared in this scope/opt/vertica/include/sqlext.h:2192: error: âBOOLâ does not name a type/opt/vertica/include/sqlext.h:2193: error: âDWORDâ does not name a type/opt/vertica/include/sqlext.h:2215: error: ISO C++ forbids declaration of âGUIDâ with no type/opt/vertica/include/sqlext.h:2215: error: expected â;â before â*â token/opt/vertica/include/sqlext.h:2216: error: âDWORDâ does not name a type/opt/vertica/include/sqlext.h:2218: error: ISO C++ forbids declaration of âWCHARâ with no type/opt/vertica/include/sqlext.h:2218: error: expected â;â before â*â token/opt/vertica/include/sqlext.h:2219: error: ISO C++ forbids declaration of âCHARâ with no type/opt/vertica/include/sqlext.h:2219: error: expected â;â before â*â token/opt/vertica/include/sqlext.h:2222: error: ISO C++ forbids declaration of âWCHARâ with no type/opt/vertica/include/sqlext.h:2222: error: expected â;â before â*â token/opt/vertica/include/sqlext.h:2223: error: ISO C++ forbids declaration of âCHARâ with no type/opt/vertica/include/sqlext.h:2223: error: expected â;â before â*â token/opt/vertica/include/sqlext.h:2228: error: âVOIDâ does not name a typeODBCLoader.cpp: In member function âvoid ODBCLoader::handleReturnCode(Vertica::ServerInterface&, int, SQLSMALLINT, SQLHANDLE, const char*)â:ODBCLoader.cpp:195: error: âSQLGetDiagRecâ was not declared in this scopeODBCLoader.cpp: In member function âvirtual Vertica::StreamState ODBCLoader::process(Vertica::ServerInterface&, Vertica::DataBuffer&, Vertica::InputState)â:ODBCLoader.cpp:267: error: âSQLBIGINTâ was not declared in this scopeODBCLoader.cpp:267: error: expected primary-expression before â)â tokenODBCLoader.cpp: In member function âvoid ODBCLoader::setQuirksMode(Vertica::ServerInterface&, SQLHDBC&)â:ODBCLoader.cpp:411: error: âSQLGetInfoâ was not declared in this scopeODBCLoader.cpp: In member function âvirtual void ODBCLoader::setup(Vertica::ServerInterface&, Vertica::SizedColumnTypes&)â:ODBCLoader.cpp:431: error: invalid conversion from âSQLHENV*â to âintâODBCLoader.cpp:431: error: initializing argument 3 of âSQLRETURN SQLAllocHandle(SQLSMALLINT, SQLHANDLE, int)âODBCLoader.cpp:434: error: invalid conversion from âvoid*â to âintâ/opt/vertica/include/sql.h:862: error: too many arguments to function âSQLRETURN SQLSetEnvAttr(SQLHENV, SQLINTEGER, int)âODBCLoader.cpp:434: error: at this point in fileODBCLoader.cpp:437: error: invalid conversion from âSQLHDBC*â to âintâODBCLoader.cpp:437: error: initializing argument 3 of âSQLRETURN SQLAllocHandle(SQLSMALLINT, SQLHANDLE, int)âODBCLoader.cpp:440: error: invalid conversion from âSQLCHAR*â to âintâ/opt/vertica/include/sqlext.h:1796: error: too many arguments to function âSQLRETURN SQLDriverConnect(SQLHDBC, void*, int)âODBCLoader.cpp:440: error: at this point in fileODBCLoader.cpp:447: error: invalid conversion from âSQLHSTMT*â to âintâODBCLoader.cpp:447: error: initializing argument 3 of âSQLRETURN SQLAllocHandle(SQLSMALLINT, SQLHANDLE, int)âODBCLoader.cpp:450: error: invalid conversion from âSQLCHAR*â to âintâ/opt/vertica/include/sql.h:707: error: too many arguments to function âSQLRETURN SQLExecDirect(SQLHSTMT, int)âODBCLoader.cpp:450: error: at this point in fileODBCLoader.cpp:453: error: invalid conversion from âSQLSMALLINT*â to âintâODBCLoader.cpp:453: error: initializing argument 2 of âSQLRETURN SQLNumResultCols(SQLHSTMT, int)âODBCLoader.cpp:472: error: âSQLBindColâ was not declared in this scopemake: *** [build/ODBCLoader.so] Error 1
Any suggestions?