SQLAPI ++를 사용하여 Visual C++ 응용 프로그램에서 Oracle에 연결하고 있습니다. VC++에서 데이터베이스에 쉽게 연결할 수 있습니다. Win32 콘솔 appliation 모드에서만 데이터베이스에 연결할 수 있습니다.Visual C++ Windows Forms 프로젝트의 링커 오류
그러나 Windows Forms 프로젝트에서 동일한 작업을 시도 할 때 다음과 같은 링커 오류가 발생합니다. 데이터베이스에 삽입하기 위해 양식에 입력 된 값이 필요하기 때문에 누군가 도와 줄 수 있습니까?
내 코드는 다음과 같습니다
#include <SQLAPI.h>
#include "stdafx.h"
#include "Form1.h"
#include <stdio.h>
using namespace sqlapi;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
SAConnection con;
SACommand cmd;
try
{
con.Connect("", "scott", "tiger", SA_Oracle_Client);
cmd.setConnection(&con);
cmd.setCommandText(
"Create table test_tbl(fid integer, fvarchar20 varchar(20), fblob blob)");
cmd.Execute();
cmd.setCommandText(
"Insert into test_tbl(fid, fvarchar20) values (1, 'Some string (1)')");
cmd.Execute();
con.Commit();
}
catch(SAException &x)
{
try
{
con.Rollback();
}
catch(SAException &)
{
}
}
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew Form1());
return 0;
}
를 내가 얻을 오류가 나는 Win32 콘솔 모드에서 오류를 얻을 해달라고
sqlapi.obj : error LNK2028: unresolved token (0A000010) "public: void __clrcall SAConnection::Rollback(void)" ([email protected]@@$$FQAMXXZ) referenced in function [email protected]@[email protected]@@@Z$0
sqlapi.obj : error LNK2028: unresolved token (0A000016) "public: void __clrcall SAConnection::Commit(void)" ([email protected]@@$$FQAMXXZ) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@$$HYMHP$0[email protected]@@@Z)
sqlapi.obj : error LNK2028: unresolved token (0A000018) "public: void __clrcall SACommand::setCommandText(class SAString const &,enum SACommandType_t)" ([email protected]@@[email protected]@[email protected]@@Z) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
sqlapi.obj : error LNK2028: unresolved token (0A000019) "public: void __clrcall SACommand::setConnection(class SAConnection *)" ([email protected]@@[email protected]@@Z) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
sqlapi.obj : error LNK2028: unresolved token (0A00001A) "public: __clrcall SAString::~SAString(void)" ([email protected]@[email protected]) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
sqlapi.obj : error LNK2028: unresolved token (0A00001B) "public: __clrcall SAString::SAString(char const *)" ([email protected]@[email protected]@Z) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
sqlapi.obj : error LNK2028: unresolved token (0A00001C) "public: void __clrcall SAConnection::Connect(class SAString const &,class SAString const &,class SAString const &,enum SAClient_t,void (__cdecl*)(class SAConnection &,enum SAConnectionHandlerType_t))" ([email protected]@@[email protected]@[email protected]@[email protected][email protected]@@[email protected]) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
sqlapi.obj : error LNK2028: unresolved token (0A00001D) "public: virtual __clrcall SACommand::~SACommand(void)" ([email protected]@[email protected]) referenced in function [email protected]@[email protected]@@@Z$0
sqlapi.obj : error LNK2028: unresolved token (0A00001E) "public: __clrcall SACommand::SACommand(void)" ([email protected]@[email protected]) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
sqlapi.obj : error LNK2028: unresolved token (0A00001F) "public: virtual __clrcall SAConnection::~SAConnection(void)" ([email protected]@[email protected]) referenced in function [email protected]@[email protected]@@@Z$0
sqlapi.obj : error LNK2028: unresolved token (0A000020) "public: __clrcall SAConnection::SAConnection(void)" ([email protected]@[email protected]) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
sqlapi.obj : error LNK2019: unresolved external symbol "public: virtual __clrcall SAConnection::~SAConnection(void)" ([email protected]@[email protected]) referenced in function [email protected]@[email protected]@@@Z$0
sqlapi.obj : error LNK2019: unresolved external symbol "public: virtual __clrcall SACommand::~SACommand(void)" ([email protected]@[email protected]) referenced in function [email protected]@[email protected]@@@Z$0
sqlapi.obj : error LNK2019: unresolved external symbol "public: void __clrcall SAConnection::Rollback(void)" ([email protected]@@$$FQAMXXZ) referenced in function [email protected]@[email protected]@@@Z$0
sqlapi.obj : error LNK2019: unresolved external symbol "public: void __clrcall SAConnection::Commit(void)" ([email protected]@@$$FQAMXXZ) referenced in function "int __clrcall main(cli::array<class System::String^>^)" ([email protected]@[email protected]@@@Z)
이다. 필자는 또한 라이브러리를 추가 종속성에 추가했습니다.
코드가 중요하지 않습니다. 이들은 내부 라이브러리 오류입니다. – NT88