1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl createVideoList(class std::basic_ifstream<char,struct std::char_traits<char> > &,class Video &)" (?createVideoList@@YAXAAV?$basic_ifstream@DU?$char_traits@D@std@@@std@@AAVVideo@@@Z) referenced in function _main
1>c:\users\******\documents\visual studio 2010\Projects\Programming Assignment 4\Debug\Programming Assignment 4.exe : fatal error LNK1120: 1 unresolved externals
我正在处理编程作业,并且在尝试编译时收到此链接错误 2019。它引用了 createVideoList,这些是与此相关的代码行:
#include <iostream>
#include <fstream>
#include <string>
#include "Video.h"
using namespace std;
void createVideoList(ifstream& infile, Video videoArray);
int main()
{
...
createVideoList(inputfile, videoArray[50]);
}
void createVideoList(ifstream& ifile, Video videoArray[50])
{
string title;
string star1;
string star2;
string producer;
string director;
string productionCo;
int inStock;
int count = 0;
Video newVideo;
getline(ifile, title);
while (ifile)
{
getline(ifile, star1);
getline(ifile, star2);
getline(ifile, producer);
getline(ifile, director);
getline(ifile, productionCo);
ifile >> inStock;
newVideo.setVideoInfo(title, star1, star2, producer,
director, productionCo, inStock);
videoArray[count] = newVideo;
getline(ifile, title);
}
}
不确定我需要在这里发布什么代码来帮助你们,因为我什至不确定错误在说什么。提前致谢!