compile issue - newbie

Marshall Wood donkieonthehead@gmail.com
Thu Apr 20 13:23:00 GMT 2006


I will state for a fact that I know that its something I am doing wrong.

Now can someone help me correct it.  Yes I am a newbie and just
learning, I learn by doing and then asking or finding the answers to
what I have done wrong.

Here is my little script.

#include <stdio.h>
#include <stdlib.h>
#include <iodbcunix.h>

int main()
{
    SQLRETURN    retcode;
    retcode = SQLConnect (NULL, "SYSDTS", NULL, "user", NULL, "pass", NULL);
    if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) {
        printf("Works!\n");
    }

}

Here is what I am seeing when I compile.

odbc2.cpp: In function 'int main()':
odbc2.cpp:7: error: 'SQLRETURN' was not declared in this scope
odbc2.cpp:7: error: expected `;' before ‘retcode’
odbc2.cpp:8: error: ‘retcode’ was not declared in this scope
odbc2.cpp:8: error: ‘SQLConnect’ was not declared in this scope
odbc2.cpp:9: error: ‘SQL_SUCCESS’ was not declared in this scope
odbc2.cpp:9: error: ‘SQL_SUCCESS_WITH_INFO’ was not declared in this scope

btw this is linux not windoze.



More information about the Gcc-help mailing list