标题:VC6.0中如何实现多个文件的编译
取消只看楼主
lwcompany
Rank: 2
等 级:论坛游民
帖 子:7
专家分:20
注 册:2009-8-18
结帖率:100%
已结贴  问题点数:5 回复次数:0 
VC6.0中如何实现多个文件的编译
em04] #include "student.h"                      //在此文件中进行函数的定义
#include <iostream>  
using namespace std;                  
void Student::display( )              
{ cout<<"num:"<<num<<endl;
  cout<<"name:"<<name<<endl;
  cout<<"sex:"<<sex<<endl;
}

void Student::set_value()
{ cin>>num;
  cin>>name;
  cin>>sex;
}
----------------------------------
#include "student.h"
//#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
 Student stud;
 stud.set_value();
 stud.display();
 return 0;
---------------------------------
class Student                     
{ public:
    void display( );  
    void set_value();               
  private:
    int num;
    char name[20];
    char sex ;
};
--------------------------------------
自已先在VC6.0做一个工程文件把头文件也加进去了,老是提示
ompiling...
student.cpp
i\2_4student类工程函数\student\student.cpp(13) : fatal error C1010: unexpected end of file while looking for precompiled header directive
student1.cpp
i:\student\student1.cpp(15) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Generating Code...
Error executing cl.exe.

student.exe - 2 error(s), 0 warning(s)
不知如何才好!感谢你的帮助!!
搜索更多相关主题的帖子: 文件 编译 
2009-08-18 16:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-283122-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.110282 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved