www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - ODBC compile errors

reply erir <erir_member pathlink.com> writes:
Hello,

I need to compile an programm with ODBC 3.0 functions. In the first step
I have made an import library for the ODBC driver (o.lib). 

Then I try to compile with the dmc. I get error messages that seems to
show problems with undefined identifier in the dmc header files. To test
the source code test8.c I have compiled it successful with another c compiler.

I like dmc very and hope there is an workaround for this problem.

Here is the output from the dmc:


C:\odbc>dmc -o test.exe test8.c o.lib
V_OD_erg=SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&V_OD_Env);
^
test8.c(25) : Error: undefined identifier 'SQL_HANDLE_ENV'
V_OD_erg=SQLSetEnvAttr(V_OD_Env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_O
BC3, 0);
^
test8.c(31) : Error: undefined identifier 'SQL_ATTR_ODBC_VERSION'
V_OD_erg = SQLAllocHandle(SQL_HANDLE_DBC, V_OD_Env, &V_OD_hdbc);
^
test8.c(39) : Error: undefined identifier 'SQL_HANDLE_DBC'
V_OD_erg=SQLAllocHandle(SQL_HANDLE_STMT, V_OD_hdbc, &V_OD_hstmt);
^
test8.c(61) : Error: undefined identifier 'SQL_HANDLE_STMT'
V_OD_erg=SQLExecDirect(V_OD_hstmt,"SELECT menu_item_name, menu_item_no FROM
menu_item",SQL_NTS);

^
test8.c(75) : Error: need explicit cast for function parameter 2 to get
Fatal error: too many errors
--- errorlevel 1


Many thanks,

Erir
Jan 06 2006
parent Arjan <arjan ask.me> writes:
erir wrote:
 Hello,
 
 I need to compile an programm with ODBC 3.0 functions. In the first step
 I have made an import library for the ODBC driver (o.lib). 
 
 Then I try to compile with the dmc. I get error messages that seems to
 show problems with undefined identifier in the dmc header files. To test
 the source code test8.c I have compiled it successful with another c compiler.
 
 I like dmc very and hope there is an workaround for this problem.
 
 Here is the output from the dmc:
 
 
 C:\odbc>dmc -o test.exe test8.c o.lib
 V_OD_erg=SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&V_OD_Env);
 ^
 test8.c(25) : Error: undefined identifier 'SQL_HANDLE_ENV'
 V_OD_erg=SQLSetEnvAttr(V_OD_Env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_O
 BC3, 0);
 ^
 test8.c(31) : Error: undefined identifier 'SQL_ATTR_ODBC_VERSION'
 V_OD_erg = SQLAllocHandle(SQL_HANDLE_DBC, V_OD_Env, &V_OD_hdbc);
 ^
 test8.c(39) : Error: undefined identifier 'SQL_HANDLE_DBC'
 V_OD_erg=SQLAllocHandle(SQL_HANDLE_STMT, V_OD_hdbc, &V_OD_hstmt);
 ^
 test8.c(61) : Error: undefined identifier 'SQL_HANDLE_STMT'
 V_OD_erg=SQLExecDirect(V_OD_hstmt,"SELECT menu_item_name, menu_item_no FROM
 menu_item",SQL_NTS);
 
 ^
 test8.c(75) : Error: need explicit cast for function parameter 2 to get
 Fatal error: too many errors
 --- errorlevel 1
 
I suspect you do not use the lates and greatest ms platform-sdk with DMC , but DMC own outdated SDK? See: http://www.digitalmars.com/faq.html http://cmeerw.org/prog/dm/ms_sdk.html
Jan 06 2006