由于GDAL中的ODBC链接错误,无法使用Visual Studio 2013构建OSG Earth

时间:2014-04-11 18:45:09

标签: c++ odbc visual-studio-2013 gdal

我正在尝试使用CMAKE和Visual Studio 2013构建OSGEarth

我首先从this page下载了Open Scene Graph 3.2和预建依赖项(小包)。我生成了visual studio 2013项目并构建/安装了Open Scene Graph而没有太多问题

之后,我下载了osgearth 2.5的源代码并使用与Open Scene Graph相同的依赖项生成了Visual Studio 2013项目(我不想在第一次构建时使用可选的依赖项)以及何时使用我尝试构建osgEarth项目,在链接步骤中出现以下错误:

2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLAllocConnect@8 referenced in function "public: int __thiscall CPLODBCSession::EstablishSession(char const *,char const *,char const *)" (?EstablishSession@CPLODBCSession@@QAEHPBD00@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLAllocEnv@4 referenced in function "public: int __thiscall CPLODBCSession::EstablishSession(char const *,char const *,char const *)" (?EstablishSession@CPLODBCSession@@QAEHPBD00@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLAllocStmt@8 referenced in function "public: __thiscall CPLODBCStatement::CPLODBCStatement(class CPLODBCSession *)" (??0CPLODBCStatement@@QAE@PAVCPLODBCSession@@@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLColAttribute@28 referenced in function "public: int __thiscall CPLODBCStatement::CollectResultsInfo(void)" (?CollectResultsInfo@CPLODBCStatement@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLColumns@36 referenced in function "public: int __thiscall CPLODBCStatement::GetColumns(char const *,char const *,char const *)" (?GetColumns@CPLODBCStatement@@QAEHPBD00@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLConnect@28 referenced in function "public: int __thiscall CPLODBCSession::EstablishSession(char const *,char const *,char const *)" (?EstablishSession@CPLODBCSession@@QAEHPBD00@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLDescribeCol@36 referenced in function "public: int __thiscall CPLODBCStatement::CollectResultsInfo(void)" (?CollectResultsInfo@CPLODBCStatement@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLDisconnect@4 referenced in function "public: int __thiscall CPLODBCSession::CloseSession(void)" (?CloseSession@CPLODBCSession@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLEndTran@12 referenced in function "public: int __thiscall CPLODBCSession::CommitTransaction(void)" (?CommitTransaction@CPLODBCSession@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLError@32 referenced in function "public: int __thiscall CPLODBCSession::Failed(int,void *)" (?Failed@CPLODBCSession@@QAEHHPAX@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLExecDirect@12 referenced in function "public: int __thiscall CPLODBCStatement::ExecuteSQL(char const *)" (?ExecuteSQL@CPLODBCStatement@@QAEHPBD@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLFetch@4 referenced in function "public: int __thiscall CPLODBCStatement::Fetch(int,int)" (?Fetch@CPLODBCStatement@@QAEHHH@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLFetchScroll@12 referenced in function "public: int __thiscall CPLODBCStatement::Fetch(int,int)" (?Fetch@CPLODBCStatement@@QAEHHH@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLFreeConnect@4 referenced in function "public: int __thiscall CPLODBCSession::CloseSession(void)" (?CloseSession@CPLODBCSession@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLFreeEnv@4 referenced in function "public: int __thiscall CPLODBCSession::CloseSession(void)" (?CloseSession@CPLODBCSession@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLFreeStmt@8 referenced in function "public: __thiscall CPLODBCStatement::~CPLODBCStatement(void)" (??1CPLODBCStatement@@QAE@XZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLGetConnectAttr@20 referenced in function "public: int __thiscall CPLODBCSession::ClearTransaction(void)" (?ClearTransaction@CPLODBCSession@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLGetData@24 referenced in function "public: int __thiscall CPLODBCStatement::Fetch(int,int)" (?Fetch@CPLODBCStatement@@QAEHHH@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLNumResultCols@8 referenced in function "public: int __thiscall CPLODBCStatement::CollectResultsInfo(void)" (?CollectResultsInfo@CPLODBCStatement@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLSetConnectAttr@16 referenced in function "public: int __thiscall CPLODBCSession::ClearTransaction(void)" (?ClearTransaction@CPLODBCSession@@QAEHXZ)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLSetConnectOption@12 referenced in function "public: int __thiscall CPLODBCSession::EstablishSession(char const *,char const *,char const *)" (?EstablishSession@CPLODBCSession@@QAEHPBD00@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLTables@36 referenced in function "public: int __thiscall CPLODBCStatement::GetTables(char const *,char const *)" (?GetTables@CPLODBCStatement@@QAEHPBD0@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLDriverConnect@32 referenced in function "public: int __thiscall CPLODBCSession::EstablishSession(char const *,char const *,char const *)" (?EstablishSession@CPLODBCSession@@QAEHPBD00@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLPrimaryKeys@28 referenced in function "public: int __thiscall CPLODBCStatement::GetPrimaryKeys(char const *,char const *,char const *)" (?GetPrimaryKeys@CPLODBCStatement@@QAEHPBD00@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLRemoveDriver@12 referenced in function "public: int __thiscall CPLODBCDriverInstaller::RemoveDriver(char const *,int)" (?RemoveDriver@CPLODBCDriverInstaller@@QAEHPBDH@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLInstallerError@20 referenced in function "public: int __thiscall CPLODBCDriverInstaller::InstallDriver(char const *,char const *,unsigned short)" (?InstallDriver@CPLODBCDriverInstaller@@QAEHPBD0G@Z)
2>gdal.lib(cpl_odbc.obj) : error LNK2019: unresolved external symbol _SQLInstallDriverEx@28 referenced in function "public: int __thiscall CPLODBCDriverInstaller::InstallDriver(char const *,char const *,unsigned short)" (?InstallDriver@CPLODBCDriverInstaller@@QAEHPBD0G@Z)

我能找到的唯一想法是所有丢失的方法似乎都被弃用了ODBC方法,如this one

有关其他信息,该项目在其继承值中引用了odbc32.lib。

1 个答案:

答案 0 :(得分:0)

好的,愚蠢的问题...... odbc的依赖项属于继承的值......但是没有检查指向构建过程使用这些依赖项的复选框。一旦完成,一切都很好......我想我需要一杯咖啡或者头上的一大块......