由于GDAL中的ODBC链接错误,无法使用Visual Studio 2013构建OSG Earth
Unable to build OSG Earth with Visual Studio 2013 due to ODBC link error in GDAL
我正在尝试使用CMAKE和Visual studio 2013 构建OSGEarth
我首先从这个页面下载了Open Scene Graph 3.2和预构建依赖项(小程序包)。我生成了visual studio 2013项目,并在没有太多问题的情况下构建/安装了开放场景图
在那之后,我下载了osgearth 2.5的源代码,并生成了Visual Studio 2013项目,使用了与Open Scene Graph相同的依赖项(我不想在第一次构建时使用可选的依赖项)。当我尝试构建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方法,比如这个
有关其他信息,该项目在其继承的值中获得了对odbc32.lib的引用。
好吧,愚蠢的问题。。。odbc的依赖项在继承的值中。。。但是没有选中向构建过程指示使用这些依赖关系的复选框。一旦完成,一切都很好。。。我想我要么喝杯咖啡,要么在头上狠狠地打一下。。。
相关文章:
- Visual Studio 2015:Extern "C" 和 "export" 关键字
- 为cl.exe(Visual Studio代码)指定命令行C++版本
- 试图在visual studio上用C++创建一个桌面应用程序
- 如何在MS Visual Studio 2019中运行QT UI
- 如何使用Visual Studio 2017在C++中为参数化对象数组使用唯一指针
- Visual Studio Code - C++ Debugger 無法啟動
- Visual Studio 2019:插入多个C++风格的单行注释
- Visual Studio Code "undefined reference to `WinMain@16'"
- Visual studio代码重构似乎不起作用(例如,重命名符号-f2)
- Visual Studio中的函数声明和函数定义问题
- 如何指定我希望我的LIB链接到的DLL文件?-Visual Studio 2019
- Visual Studio mkl_link_tool.exe链接错误
- Visual Studio(或任何其他工具)能否将地址解释为调用堆栈(boost上下文)的开头
- 不同的Visual Studio版本中缺少.dll
- 用Visual Studio在C++中嵌入Julia
- Visual Studio 2017循环自动向量化问题
- 有没有办法在远程设备上打开和编辑visual Studio 2017解决方案
- 尝试使用继承和模板实现CRTP.Visual Studio正在生成编译器错误
- Visual Studio在尝试读取resource.txt文件时崩溃
- Visual Studio 2017 不允许我创建 C++ 专用模板