Following on from this question: Getting list of available ODBC data sources in my Qt application
When I compile the code in the answer I get an "unresolved external symbol" error.
In my MainWindow I have hadded the following includes:
#include <windows.h>
#include <tchar.h>
#include <iostream>
#include <sql.h>
#include <sqlext.h>
#include <sqlucode.h>
and have created a function like so:
int listDataSources()
{
// Get an Environment handle
SQLHENV hEnv = SQL_NULL_HENV;
SQLRETURN ret = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hEnv);
if( ! SQL_SUCCEEDED(ret) ) {}
SQLFreeHandle(SQL_HANDLE_ENV, hEnv);
return 0;
}
The errors reported area:
The sql.h file in use has the following section:
This is definitely the file being used and ODBCVER is greater than 0x0300 as if I place a #define MIKEDIDTHIS = 777 after the ODBCVER test it gets set and I can dDebug() it.
ODBCVER is set ealrier in the file with this code:
#ifndef ODBCVER
#define ODBCVER 0x0380
#endif
I'm using Qt Creator version 3.4.2 and Qt 5.5.0 (MSVC 2013 32 bit)
Can you walk me through the steps I should take in trying to find the cause of the problem?