VS 中的 C++:错误 LNK 2019 未解决的符号错误

C++ in VS : Error LNK 2019 Unresolved Symbol Error

所以我正在编写一个带有登录名的菜单。 登录阶段检查用户和密码是否与数据库 (phpMyAdmin) 中的匹配。

但是我的函数出错了,我不知道为什么。

这是我的主要(cpp):

// Kassasysteem.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <tchar.h>
#include "KlassenVerzameling.h"


using namespace std; 

int inloggen();
void menu(int userID);


int _tmain(int argc, _TCHAR* argv[])
{
UserDAO admin;

#ifdef User_Offline
    admin.Init();
#endif
    UserDAO gebruikers;
    int userID = 0;
    bool doorgaan = true;

    while (doorgaan)
    {
        userID = inloggen();

        cout << "Welkom " << gebruikers.getUser(userID)->getGebr_naam() << "!" << endl << endl;
    }

    return 0;
}

int inloggen(){
    UserDAO users;

#ifdef User_Offline
        users.Init();
#endif

        string naam, wachtwoord;

        cout << "Gebruikersnaam (leeg om af te sluiten)? ";
        getline(cin, naam);

        if (naam.empty())
        {
            return -1;
        }
        else {
            wachtwoord = hiddenline("Wachtwoord? ");
            cout << "Verificatie gebruiker...";
            User* gebruiker = users.getUserByName(naam);

            if (gebruiker == 0)
            {
                return -2;
            }
            else {
                if (gebruiker->getWachtwoord() == wachtwoord)
                {
                    return gebruiker->getUserID();
                }
                else {
                    return -2;
                }
            }
        }

#ifdef User_Offline
        users.Dispose();
#endif

} 

我声明函数的头文件(我用于密码检查):

#ifndef SPECIALEINVOER_H_INCLUDED
#define SPECIALEINVOER_H_INCLUDED


string hiddenline(string prompt, char masker = '*');
void setXY(int, int);
int wherex();
int wherey();

#endif

以及我的密码检查过程的功能所在的 .cpp 文件:

#include "stdafx.h"
#include "specialeInvoer.h"

HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);

string hiddenline(string prompt, char masker)
{
    string wachtwoord;
    cout << prompt;
    int x = wherex();
    int y = wherey();
    char c = _getch();

    while (c != 13) //13 = ENTER
    {
        if (c == 8) //backspace
        {
            if (!wachtwoord.empty())
            {
                wachtwoord.pop_back();
                setXY(--x, y);
                cout << " ";
                setXY(x, y);
            }
        }
        else {
            wachtwoord.push_back(c);
            cout << masker;
            x++;
        }
        c = _getch();
    }
    cout << endl;
    return wachtwoord;
}

我没有语法错误只有这些类型的错误:(对于函数 whereex、wherey 和 setXY)。

Error   5   error LNK2019: unresolved external symbol "int __cdecl wherex(void)" (?wherex@@YAHXZ) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl hiddenline(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char)" (?hiddenline@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@D@Z)    

有些帮助会很棒,我在 stackover 上潜伏了很长一段时间,但大多数时候我看到奇怪的答案,但并不是真正对我有帮助的答案。

感谢

如评论所述:

您的函数 wherexwhereysetXY 未在您的代码中实现。 您已经实现了 hiddenline,为什么其他人没有?

还有你的函数setXY(int, int)应该是setXY(int a, int b)