Hi,
I'm a newbie using Dev-C++ 4.9.9.2 on Windows. I'm trying to connect to an Oracle Database using odbc. I tried to see if the program compiles and links. I have the following directories in my Tools->Compiler Options->Directories->Libraries
C:\ProgramFiles\Dev-Cpp\lib
C:\WINDOWS\system32\
Here's the code
[Linker error] undefined reference to `SQLAllocHandle@12'
What am I missing? Is there a specific command to load the odbc DLL? If so what is it? I do have ODBC32.DLL in my C:\WINDOWS\system32 directory.
Any help would be appreciated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a section in the FAQ thread in this forum on the compile log, including headers and linking libraries - granted, it is talking about static libraries, but for most dll's there is a static library you need to link
Also, please check out the secion on the Basic 3 pieces of information. When you just excerpt the error, you thow away 80% - 100% of the information that we could use to help you.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm a newbie using Dev-C++ 4.9.9.2 on Windows. I'm trying to connect to an Oracle Database using odbc. I tried to see if the program compiles and links. I have the following directories in my Tools->Compiler Options->Directories->Libraries
C:\ProgramFiles\Dev-Cpp\lib
C:\WINDOWS\system32\ Here's the code
include <windows.h>
include <sqlext.h>
int main()
{
SQLHENV henv; //Environment handle
SQLHDBC hdbc; //Connection handle
SQLHSTMT hstmt; //Statement handle
SQLAllocHandle(SQL_HANDLE_ENV,SQL_NULL_HANDLE,&henv);
}
Here's the error:
[Linker error] undefined reference to `SQLAllocHandle@12'
What am I missing? Is there a specific command to load the odbc DLL? If so what is it? I do have ODBC32.DLL in my C:\WINDOWS\system32 directory.
Any help would be appreciated
Linker Option: -lodbc32
from a project will link library file libodbc32.a
http://img.photobucket.com/albums/v681/Br5an/link.jpg
if you need an example.
There is a section in the FAQ thread in this forum on the compile log, including headers and linking libraries - granted, it is talking about static libraries, but for most dll's there is a static library you need to link
Also, please check out the secion on the Basic 3 pieces of information. When you just excerpt the error, you thow away 80% - 100% of the information that we could use to help you.
Wayne