Solved

Link error using "SQLBindFileToCol" with Visual Studio c++.NET

Posted on 2004-03-30
3
256 Views
Last Modified: 2011-09-20
I am using Visual Studio C++ .NET but I was using Visual Age C++ to compile my C++ DB2 programs.  When I do statement  
"rc = SQLBindFileToCol(hstmt2, 1, FName, &FNLength, &FOption,50, NULL, &FNInd);"  
I get error message "MAIS700.obj : error LNK2019: unresolved external symbol _SQLBindFileToCol@32 referenced in function "int __cdecl Query_Request_Data(void)" (?Query_Request_Data@@YAHXZ)"

All of my other SQL calls are good.  I include "sqlcli1.h" from the SQL Lib. Does this compiler not support "SQLBindFileToCol" or do I need to include something else????
0
Comment
Question by:larryH
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 50 total points
ID: 10714600
You need to include .lib file to project linker settings.
Project - Properties - Linker - Input - Additional dependencies. Write here lib file name where this function is placed (for example, SQL.lib). See library name in documentation.
0
 

Author Comment

by:larryH
ID: 10714838
I included "c:\Program Files\sqllib\lib\db2cli.lib" and the error went away. Is this needed because Microsoft ODBC DB2 interface does not support this function so I needed to get it from IBM that does???
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 10715736
I didn't use this function. Generally, every Dll has appropriate lib and include files. Dll is used at run-time, h and lib are needed for compilation and translation. SQLBindFileToCol function is kept in db2cli.lib.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now