If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > odbc problems

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-15-03, 12:58
vss3 vss3 is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
odbc problems

I don't know if this is the right forum for this question but I'll give it a shot anyway.

I'm trying to connect to a Sql Server database using c++. But everytime I compile, I get a linking error, and the compiler says that some of the functions I used, such as SQLConnect and SQLAllocStmt are undefined references. I've pretty much figured out that I need to link the library libodbc32.a into this program. I'm using Cygwin on Windows 98. My Cygwin libraries, which include libodbc32.a, are in C:\Cygwin\lib\w32api directory. And my c++ application is in C:\Project\src directory. Now I've a lot of ways of linking but nothing seems to be working, i.e.

g++ -l C:\Cygwin\lib\w32api\libodbc32.a -o main.exe main.cpp

or

g++ -l \c\Cygwin\lib\w32api\libodbc32.a -o main.exe main.cpp
where \c is the mounted windows file system which maps to C:\.

And with these commands, the compiler always says it can't find that library. Anybody no what I'm doing wrong. Any help will be appreciated. Thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On