//opgave 8.6.1(1)
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include "krypto.h"
#include "krypto.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
krypto data;
cout << "skriv her:";
data.hentdata();
system("pause");
return 0;
}
//Krypto.h
#pragma once
class krypto
{
public:
krypto();
void hentdata();
private:
char data;
};
//krypto.cpp
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include "krypto.h"
using namespace std;
krypto::krypto()
{
}
void hentinput(){
char data;
cout << "Skriv dit input: ";
cin >> data;
cout << data;
}我找不到错误!有人能帮忙吗?
错误1错误LNK2019:未解决的外部符号"public: void __thiscall氪in::hentdata(Void)“(?hentdata@krypto@@QAEXXZ)在函数_wmain C:\Users\LAB\Documents\steffen\c++ opgaver\bogen\opgave 8.6.3(1) \opgid8.6.3(1).obj opgid8.6.3(1)中引用。
错误2错误LNK1120: 1未解决的外部因素C:\Users\LAB\Documents\steffen\c++ opgaver\bogen\op待8.6.3(1)\Debug\op节8.6.3(1).exe 1 1选项8.6.3(1)错误2
发布于 2014-08-07 08:39:51
改变这一点:
void hentinput()
{
char data;
...
}对此:
void krypto::hentdata()
{
...
}https://stackoverflow.com/questions/25177828
复制相似问题