我刚才在additional include directory里面将oracle_home填加进去了,
编译是成功了,但是出现以下12个错误:
xa_diag.obj : error LNK2001: unresolved external symbol _OCIHandleAlloc
xa_diag.obj : error LNK2001: unresolved external symbol _xaoSvcCtx
xa_diag.obj : error LNK2001: unresolved external symbol _xaoEnv
xa_diag.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct xa_switch_t xaoswd" (__imp_?xaoswd@@3Uxa_switch_t@@A)
xa_diag.obj : error LNK2001: unresolved external symbol _OCIStmtExecute
xa_diag.obj : error LNK2001: unresolved external symbol _OCIStmtPrepare
xa_diag.obj : error LNK2001: unresolved external symbol _OCIBindByName
xa_diag.obj : error LNK2001: unresolved external symbol _OCIStmtFetch
xa_diag.obj : error LNK2001: unresolved external symbol _OCIDefineByPos
xa_diag.obj : error LNK2001: unresolved external symbol _OCIBindByPos
xa_diag.obj : error LNK2001: unresolved external symbol _OCIErrorGet出现这些错误不知道是怎么回事?
好像我oci没装一样,但是我肯定是装了的。
编译是成功了,但是出现以下12个错误:
xa_diag.obj : error LNK2001: unresolved external symbol _OCIHandleAlloc
xa_diag.obj : error LNK2001: unresolved external symbol _xaoSvcCtx
xa_diag.obj : error LNK2001: unresolved external symbol _xaoEnv
xa_diag.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct xa_switch_t xaoswd" (__imp_?xaoswd@@3Uxa_switch_t@@A)
xa_diag.obj : error LNK2001: unresolved external symbol _OCIStmtExecute
xa_diag.obj : error LNK2001: unresolved external symbol _OCIStmtPrepare
xa_diag.obj : error LNK2001: unresolved external symbol _OCIBindByName
xa_diag.obj : error LNK2001: unresolved external symbol _OCIStmtFetch
xa_diag.obj : error LNK2001: unresolved external symbol _OCIDefineByPos
xa_diag.obj : error LNK2001: unresolved external symbol _OCIBindByPos
xa_diag.obj : error LNK2001: unresolved external symbol _OCIErrorGet出现这些错误不知道是怎么回事?
好像我oci没装一样,但是我肯定是装了的。
我当时不知道在哪里加,加哪些,
现在知道了。但是又有一个问题,
程序中有这样一段:
#ifdef WIN32
extern __declspec(dllimport) struct xa_switch_t xaoswd;
#else
struct xa_switch_t xaoswd;
#endif 但是link时,说
error LNK2001: unresolved external symbol "__declspec(dllimport) struct xa_switch_t xaoswd" (__imp_?xaoswd@@3Uxa_switch_t@@A)
Debug/xa_diag.exe : fatal error LNK1120: 1 unresolved externals这个问题怎么解决?
#define WIN32把它去掉
/* Declare the structure for dynamic registration
- if we are on NT we have to import the structure */
include<$oralce_home\oci\include\oci.h>换一下试试:#ifdef WIN32
extern "C" __declspec(dllimport) struct xa_switch_t xaoswd;
#else
struct xa_switch_t xaoswd;
#endif
并且现在也不用写。一切都正常了。
真是太感谢你了。呵呵。。