小编Bri*_*ian的帖子

"1个未解析的外部"C++

我检查了所有文件之间的连接,以及类和函数定义,但每次我尝试运行我的程序时它都会阻止我并告诉我它有"1个未解析的外部".

该程序应该打开多个文件(一个"学生"文件和一个"成绩"文件),从中读取,然后使用"查询文件"查看数据,查找学生在查询中要求的内容文件,并将其打印到新文件.混乱?是.

尽管如此,我还是非常接近解决方案,但因为我使用的是Visual Studio,所以在我找到并结束"1未解析的外部"之前,它甚至不会让我运行该程序.它甚至不会告诉我错误在哪里.我对C++很陌生,无论我搜索多么努力,我似乎​​无法解决这个问题.

这是我的主要计划:

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <fstream>

#include "Student.h"

using namespace std;

int main(){



    //Request a file to read from, and open it (I haven't declared the files yet, don't worry about that)
    ifstream input_file;
    string studentfile = "";
    string gradefile = "";
    string queryfile = "";


    //Create a Map for the Students
    map<string, Student *> student_map;

    //Open the Student file and load it in
    cout << "Loading \"" << studentfile << …
Run Code Online (Sandbox Code Playgroud)

c++ visual-c++

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

visual-c++ ×1