Ankit Aggarwal wrote:
> I want to use database for one of my project instead of Flat Files. But, I
> am facing some problem connecting C Program to Database. I tried and
> searched for problem for almost 4 hours now.
> 
> *Configuration :*
> 
>    - I am using *Windows XP* as OS
>    - *Dev -C++* as Compiler (it uses gcc in backend I guess)
>    - *MySQL* Database
>    - *ODBC* is set-up and running properly
> 
> 
> *The Problem :*
> I am unable to tell the Linker where the ODBC library file is (this is what
> I can get from searches). Here is the *Error Log* :
> 
> Compiler: Default compiler
> Executing  g++.exe...
> g++.exe "E:\db_conn.cpp" -o "E:\db_conn.exe"   -g3
> -I"C:\Dev-Cpp\include\c++"  -I"C:\Dev-Cpp\include\c++\mingw32"
> -I"C:\Dev-Cpp\include\c++\backward"  -I"C:\Dev-Cpp\include"
> -L"C:\Dev-Cpp\lib"
> C:\DOCUME~1\ME62CF~1\LOCALS~1\Temp/ccgtaaaa.o(.text+0x12f): In function
> `main':
> E:/db_conn.cpp:32: undefined reference to `sqlalloc...@4'
> C:\DOCUME~1\ME62CF~1\LOCALS~1\Temp/ccgtaaaa.o(.text+0x141):E:/db_conn.cpp:35:
> undefined reference to `sqlallocconn...@8'
<snip>
> 
> Execution terminated
> 
> *The Program :*
> I am attaching the program with the mail. If anyone could help please reply.
> Its bit important for me.
> 
> 
> Best.
> --
> Ankit Aggarwal
> Proud Member of CLUBMCA <http://bit.ly/d1Hrbj>

You need to add 'odbc32.lib' to your linker settings.  Make sure your 
compiler and linker knows where you installed the Windows SDK to or you 
will have to supply full path information as well.

-- 
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197

*NEW* MyTaskFocus 1.1
Get on task.  Stay on task.

http://www.CubicleSoft.com/MyTaskFocus/

Reply via email to