Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9038595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:31:32+00:00 2026-06-16T09:31:32+00:00

I am trying to connect my c++ client to an PostgreSQL DB. I keep

  • 0

I am trying to connect my c++ client to an PostgreSQL DB. I keep getting otlv4.h|12406|undefined reference to `SQLFreeHandle@8′ and many other undefined reference errors.

To get the header file go to http://otl.sourceforge.net/otl3_down.htm

#include <iostream>

using namespace std;

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// #define OTL_ODBC_UNIX // uncomment this line if UnixODBC is used
#define OTL_ODBC_ALTERNATE_RPC
#if !defined(_WIN32) && !defined(_WIN64)
#define OTL_ODBC
#else
#define OTL_ODBC_POSTGRESQL // required with PG ODBC on Windows
#endif
#include "otlv4.h" // include the OTL 4.0 header file

otl_connect db; // connect object

int main()
{

    otl_connect::otl_initialize(); // initialize ODBC environment

    db.rlogon("postgres/changeme@numbers");

    db.commit();

    cout << "Hello world!" << endl;

    db.logoff(); // disconnect from ODBC
    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:31:33+00:00Added an answer on June 16, 2026 at 9:31 am

    When I did connection from Windows to PostgreSQL using ODBC, I used DSN-less approach. It requires zero input from user perspective – user does not need to know what ODBC is and how to configure ODBC source (DSN).

    Typical way to use DSN-less connection is to use string like below as your ODBC connection string:

    Driver=PostgreSQL;Server=hostname;Database=mypgdb;UID=username;PWD=password
    

    Note that driver name may need to be adjusted depending on version and ANSI vs Unicode flavors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi, I'm trying to connect my chat client to my server, but I keep
I am trying to connect to a standalone desktop tcp server(java) from tcp client
Using persistent connections and an ASP.NET JavaScript client, I am trying to connect to
I am playing around with node.js and socket.io-client. I am trying to connect to
I'm trying to start a very simple jWebSocket Client on Android and connect it
I am trying to connect many socket.io clients for different URLs in Node.js like
i'm trying to connect a php client with a Java WS, i'm working on
I am trying to connect as a client over SSL and am seeing some
I'm trying to connect an application (the client) to an exposed WCF service, but
When trying to connect to EC2 over SSH I get the following error: joshua-scotts-macbook-pro:.ec2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.