小编Bip*_*Adh的帖子

C ++中的未定义参考错误

我正在为c ++中的类方法之一获得未定义的引用。错误是“部门的每个方法调用的对'Department :: getNameabi:cxx11'的未定义引用和其他许多行。

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <vector>

#include "department.h"

using namespace std;

void addDepartment();
void writeToFile();
void showArt();
void removeDepartment();

vector <Department> departments;


int main()
{
    int choice;
    do
    {
        cout<<"1)Add asset \t 2)Remove Asset \t 3)Departmental Options \t 4)Quit"<<endl;
        cin>>choice;
        switch( choice )
        {
            case 1: addDepartment();
                    break;

            case 2: removeDepartment();
                    break;

            case 3: //showReport();
                    break;

        }

        addDepartment();
    }while(choice != 4);

}

void showArt()
{
    cout<<"ASSET MANGEMENT"<<endl;
}

void addDepartment()
{
    string name;
    cout<<"Ener …
Run Code Online (Sandbox Code Playgroud)

c++ compiler-errors

0
推荐指数
1
解决办法
6714
查看次数

标签 统计

c++ ×1

compiler-errors ×1