I am trying to build OSGEarth using CMAKE and Visual studio 2013

I first downloaded Open Scene Graph 3.2 and the prebuild dependencies (small package) from this page. I generated the visual studio 2013 project and build/installed Open Scene Graph without much problem

After that, I downloaded the source of osgearth 2.5 and generated the Visual Studio 2013 project, using the same dependencies as for Open Scene Graph (I don't want to use the optional dependencies for the first build) and when I try to build the osgEarth project, I got the following error at the linking step :

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)

The only think I was able to find is that all the missing method seems to be deprecated ODBC method, like this one

For additional information, the project got a reference to odbc32.lib in its inherited values.

有帮助吗?

解决方案

Okay, stupid question... the odbc's dependencies were in the inherited values... but the checkbox indicated to the build process to use these dependencies was not checked. Once it was done, everything is good... I think I need either a coffee or a very big smack on the head...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top