Menu

Dev-C++ - odbc - Oracle

2005-08-10
2012-09-26
  • Nobody/Anonymous

    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

     
    • Nobody/Anonymous

      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.

       
    • Wayne Keen

      Wayne Keen - 2005-08-10

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.