1

我正在编写一个 C++ 控制台应用程序来测试 API。我...\SDK\include\在“其他包含目录”下添加了文件夹路径。这是我的主 .cpp 文件的代码:

#include "stdafx.h"
#include <iostream>
#include "aaapi.h"
#include "aaapidef.h"
#include "aaapiver.h"
#include "aaatypes.h"
#include "aadmsapi.h"
#include "aadmsdef.h"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    LPCWSTR dbName=L"xyz.com:abc";
    LPCWSTR user=L"";
    LPCWSTR pwd=L"";
    LPCWSTR schema=L"";
    bool resultInit=aaApi_Initialize(AAMODULE_ALL);
    bool resultLogin=aaApi_Login(AAAPIDB_UNKNOWN,dbName,user,pwd,schema);
    return 0;
}

我收到这些错误:

unresolved external symbol _aaApi_Initialize@4 referenced in function _wmain
unresolved external symbol _aaApi_Login@20 referenced in function _wmain

从错误来看,似乎两个 API 函数都未定义,但我认为这些#include语句会解决这个问题,特别是因为它们的函数头出现在 Intellisense 中。

我在这里想念什么?

4

1 回答 1

2

#include 语句用于编译器。该消息来自链接器。你必须告诉它对应的 .obj 文件在哪里。

于 2013-09-20T00:17:24.010 回答