- I created my own ODBC wrapper class which handles SQL from C++ Win32 application.
- I have copied and Added (as existing) this class to my MFC application.
Now I have terrible linking problems with unresolved external symbols (which were NOT present in the Win32 perfectly working app), such as this: "
Error 56
error LNK2019: unresolved external symbol _SQLSetStmtAttr@16 referenced in function "public: int __thiscall Cosql::ODBCconnect(char *)" (?ODBCconnect@Cosql@@QAEHPAD@Z)C:\Documents and Settings.........\Cosql.obj ApplicationName "
How can I PROPERLY include "sqlext.h" (and "sql.h") from
C:\Program Files\Microsoft SDKs\Windows\v7.0A in my MFC application or MORE importantly: How to resolve those external symbols?Am I the only one trying to ODBC-connect from a MFC app and having this trouble ??? :O
I Just know that "SQLSetStmtAttr" function is there defined only for ODBCVER 3.0 and higher. Well ! But HOW do I set ODBCVER in my MFC app. ??? I have no idea.
EDIT: I figured out that ODBCVER is defined: 0x0380 (so it is ver. 3.8), all functions are defined correctly by those includes: sql.h and sqlext.h ,
EDIT II: Linking ERROR开发者_如何学Python persists when I convert all those methods (object) into pure functions using some global variables!
Thanx in advance.
Solved.
Solution: I created a DLL from my ODBC class and then used it in my project. Now it is compiled independently so it does not restrict each other's INCOMPATIBLE environment and compiler settings anymore!
精彩评论