注册 登录
编程论坛 C++教室

不知哪里有错,无法运行,求指点改正,谢谢

随风晨爱 发布于 2018-11-28 16:08, 1814 次点击
有一道题:某企业有财务管理,工程管理和市场管理三方面管理事物,开发具有菜单功能的程序框架,实现这方面的管理。具体管理内容不予考虑代码如下,不知哪里有错,无法运行,求指点改正,谢谢

#include <iostream>
using namespace std;
void menu_print();
void account_report();
void engineering_report();
void marketing_report();
int main ()
{
    int choice;
    do{
        menu_print();
        cin >> choice;
    }while (choice <=0|| choice >=4);
    switch(choice)
    {
    case 1: account_report(); break;
    case 2: engineering_report();break;
    case 3: marketing_report(); break;
    }
    return 0;
}
void menu_print()
{
    cout << "系统功能" << endl;
    cout << "1.财务管理" << endl;
    cout << "2.工程管理" << endl;
    cout << "3.市场管理" << endl;
}
void account_report()
{
    cout << "生成财务管理" << endl;
}

void engineering_report()
{
    cout << "生成工程管理" <<endl;
}
void marketing_rport()
{
    cout << "生成生成市场管理" << endl;
}
4 回复
#2
rjsp2018-11-28 16:27
不要说“无法运行”,除了你自己之外,别人不知道是什么意思?

我编译链接了一下,报错
error LNK2019: unresolved external symbol "void __cdecl marketing_report(void)" referenced in function _main

查看代码,果然没有 marketing_report 的定义,只有 marketing_rport 的定义,我猜你是将
marketing_report 错写成
marketing_rport 了
#3
Jonny02012018-11-28 16:28
void marketing_rport() 什么玩意儿?
#4
随风晨爱2018-11-28 18:31
回复 2楼 rjsp
#5
随风晨爱2018-11-28 18:31
回复 3楼 Jonny0201
1