0

I have been trying to connect to mysql using OTL_ODBC. I have included the OTL header file (otlv4.h) in my Visual Studio 2010 Project but when I try to use otl_connect, it displays the error "Cannot Resolve Symbol otl_connect", and the otl_connect class appears red in colour:

enter image description here

May I know where I'm doing it wrong?

#define OTL_ODBC
#include "otlv4.h"
int main(int argc, char* argv[])
{
  otl_connect db;
}
Keshav
  • 47
  • 1
  • 7
  • Including the header is not sufficient. You also need to link to the library. This has been asked and answered many times, but the canonical duplicate is [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – underscore_d Dec 06 '17 at 12:22
  • I'm really sorry but its not linking error, the otl_connect itself appears **RED** in colour which implies that the class otl_connect doesnt exist. – Keshav Dec 06 '17 at 12:30
  • Well, then you need to write better questions. :P The title says "Unresolved external symbol", which indicates a linker error. If that's not your problem, don't make that your title. And if your problem is a syntax warning in the IDE, explain that in the post, otherwise people will probably assume it was a compiler error instead – underscore_d Dec 06 '17 at 12:31
  • Oh I'm really sorry, this is my second post , I wouldnt make the mistake again :D – Keshav Dec 06 '17 at 12:34
  • I've voted to close this question as unclear since OP clearly describe a _linking_ error in their title but talk about a compilation error in their comments. – YSC Dec 06 '17 at 12:42
  • I have changed the title of the question, Sorry for the inconvenience caused.. – Keshav Dec 06 '17 at 12:44

2 Answers2

0

otl_connect is inside namespace odbc. Try odbc::otl_connect.

Eylon
  • 51
  • 3
  • It doesn't resolve it either. In every other tutorial, it has been written as just otl_connect, i dont know why it doesnt work – Keshav Dec 06 '17 at 12:38
0

I had the same today. The solution was to place #include "otlv4.h" after #define OTL_ODBC_MSSQL_2008.

Fuel
  • 13
  • 2