
Шустрый

Профиль
Группа: Участник
Сообщений: 139
Регистрация: 28.2.2009
Где: pnz
Репутация: нет Всего: нет
|
Что означают эти ошибки? | Цитата | ------ Build started: Project: l4v1s23, Configuration: Debug Win32 ------ Compiling... StudentSQL_.cpp Linking... StudentSQL_.obj : error LNK2028: unresolved token (0A00000A) "extern "C" short __stdcall SQLDisconnect(void *)" (?SQLDisconnect@@$$J14YGFPAX@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2028: unresolved token (0A00000B) "extern "C" short __stdcall SQLFreeHandle(short,void *)" (?SQLFreeHandle@@$$J18YGFFPAX@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2028: unresolved token (0A00000D) "extern "C" short __stdcall SQLGetInfoW(void *,unsigned short,void *,short,short *)" (?SQLGetInfoW@@$$J220YGFPAXG0FPAF@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2028: unresolved token (0A000010) "extern "C" short __stdcall SQLGetFunctions(void *,unsigned short,unsigned short *)" (?SQLGetFunctions@@$$J212YGFPAXGPAG@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2028: unresolved token (0A000011) "extern "C" short __stdcall SQLConnectW(void *,wchar_t *,short,wchar_t *,short,wchar_t *,short)" (?SQLConnectW@@$$J228YGFPAXPA_WF1F1F@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2028: unresolved token (0A000012) "extern "C" short __stdcall SQLSetConnectAttrW(void *,long,void *,long)" (?SQLSetConnectAttrW@@$$J216YGFPAXJ0J@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2028: unresolved token (0A000013) "extern "C" short __stdcall SQLSetEnvAttr(void *,long,void *,long)" (?SQLSetEnvAttr@@$$J216YGFPAXJ0J@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2028: unresolved token (0A000014) "extern "C" short __stdcall SQLAllocHandle(short,void *,void * *)" (?SQLAllocHandle@@$$J212YGFFPAXPAPAX@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLDisconnect(void *)" (?SQLDisconnect@@$$J14YGFPAX@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLFreeHandle(short,void *)" (?SQLFreeHandle@@$$J18YGFFPAX@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLGetInfoW(void *,unsigned short,void *,short,short *)" (?SQLGetInfoW@@$$J220YGFPAXG0FPAF@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLGetFunctions(void *,unsigned short,unsigned short *)" (?SQLGetFunctions@@$$J212YGFPAXGPAG@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLConnectW(void *,wchar_t *,short,wchar_t *,short,wchar_t *,short)" (?SQLConnectW@@$$J228YGFPAXPA_WF1F1F@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLSetConnectAttrW(void *,long,void *,long)" (?SQLSetConnectAttrW@@$$J216YGFPAXJ0J@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLSetEnvAttr(void *,long,void *,long)" (?SQLSetEnvAttr@@$$J216YGFPAXJ0J@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) StudentSQL_.obj : error LNK2019: unresolved external symbol "extern "C" short __stdcall SQLAllocHandle(short,void *,void * *)" (?SQLAllocHandle@@$$J212YGFFPAXPAPAX@Z) referenced in function "public: void __clrcall StudentSQL_::startSQL(void)" (?startSQL@StudentSQL_@@$$FQAMXXZ) C:\Documents and Settings\1\Мои документы\Visual Studio 2008\Projects\l4v1s23\Debug\l4v1s23.exe : fatal error LNK1120: 16 unresolved externals Build log was saved at "file://c:\Documents and Settings\1\Мои документы\Visual Studio 2008\Projects\l4v1s23\l4v1s23\Debug\BuildLog.htm" l4v1s23 - 17 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
|
| Код | #include "stdafx.h" #include "StudentSQL_.h"
void StudentSQL_::startSQL() { i = 5; rgbValue = &i; bufferSize = 1024; dbName = (wchar_t *)malloc( sizeof(wchar_t)*bufferSize );
OutConnStr = (SQLCHAR * )malloc(255); OutConnStrLen = (SQLSMALLINT *)malloc(255); // Allocate environment handle retcode = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
// Set the ODBC version environment attribute if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { retcode = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
// Allocate connection handle if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { retcode = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
// Set login timeout to 5 seconds if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { SQLSetConnectAttr(hdbc, SQL_LOGIN_TIMEOUT, (SQLPOINTER)(rgbValue), 0);
// Connect to data source retcode = SQLConnect(hdbc, (SQLWCHAR*) "source_pubs", SQL_NTS, (SQLWCHAR*) "1", 0, (SQLWCHAR*) "", 0);
// Allocate statement handle if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { SQLGetFunctions(hdbc, SQL_API_SQLALLOCHANDLE, &AllocEnvExists); SQLGetFunctions(hdbc, SQL_API_SQLMORERESULTS, &MoreResultsExists); SQLGetFunctions(hdbc, SQL_API_SQLDRIVERCONNECT, &DriverConnectExists); SQLGetFunctions(hdbc, SQL_API_SQLROWCOUNT, &RowCountExists);
if (AllocEnvExists && MoreResultsExists && DriverConnectExists \ && RowCountExists) { printf("Podderjivayutsya\n - AllocEnvExists\n - MoreResultsExists\n \ \r - DriverConnectExists\n - RowCountExists\n"); /* Continue with application */ _getch(); } else { _getch(); } retcode = SQLGetInfo(hdbc, SQL_DATABASE_NAME, dbName, (SQLSMALLINT)bufferSize, (SQLSMALLINT *)&bufferSize); printf("Imya bazy dannyh\n%s\n", dbName); _getch(); retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
// Process data if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO) { SQLFreeHandle(SQL_HANDLE_STMT, hstmt); }
SQLDisconnect(hdbc); }
SQLFreeHandle(SQL_HANDLE_DBC, hdbc); } } SQLFreeHandle(SQL_HANDLE_ENV, henv); } }
|
| Код | #include <windows.h> #include <sqlext.h> #include <stdio.h> #include <conio.h>
class StudentSQL_ { public: SQLHENV henv; SQLHDBC hdbc; SQLHSTMT hstmt; SQLRETURN retcode; SQLPOINTER rgbValue; SQLUSMALLINT AllocEnvExists, MoreResultsExists, DriverConnectExists, RowCountExists; int i; int bufferSize; wchar_t* dbName;
SQLCHAR * OutConnStr; SQLSMALLINT * OutConnStrLen;
StudentSQL_() {startSQL();} void startSQL(void); System::String^ Hello() {return "Hello";} };
|
|