两个人 发表于 2013-12-9 20:37:42

请教:怎样添加头文件在VC6.0里 ,怎么设置VC6.0?

本帖最后由 两个人 于 2013-12-12 20:11 编辑

怎样添加头文件在VC6.0里 ,怎么设置VC6.0?在目录里设置的不行!!!总是提示::::::::::::::::::::

--------------------Configuration: Text1 - Win32 Debug--------------------
Linking...
Text1.obj : error LNK2001: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Employee::get_name(void)const " (?get_name@Employee@@QBE?AV?$basic_string@DU?$char_trai
ts@D@std@@V?$allocator@D@2@@std@@XZ)
Text1.obj : error LNK2001: unresolved external symbol "public: void __thiscall Employee::set_salary(double)" (?set_salary@Employee@@QAEXN@Z)
Text1.obj : error LNK2001: unresolved external symbol "public: double __thiscall Employee::get_salary(void)const " (?get_salary@Employee@@QBENXZ)
Text1.obj : error LNK2001: unresolved external symbol "public: __thiscall Employee::Employee(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,double)" (??0Employee@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?
$allocator@D@2@@std@@N@Z)
Debug/Text1.exe : fatal error LNK1120: 4 unresolved externals
执行 link.exe 时出错.


--------------------配置:文本1 - Win32调试--------------------
链接...
Text1.obj :错误LNK2001:无法解析的外部符号“公众:一流的std :: basic_string的<字符,结构的std :: char_traits <Char>来,类的std ::分配器<Char>来> __ thiscall员工:: get_name (无效)常量” ( ? @ @ QBE ? AV? $ basic_string的get_name @ @雇员杜? $ char_trai
TS @ D @ STD @ @ V ? $分配器@ D @ 2 @ @ STD @ @ XZ )
Text1.obj :错误LNK2001:无法解析的外部符号“公共语句:void __ thiscall员工:: set_salary (双) ” ( @ @ QAEXN @ Z set_salary @员工? )
Text1.obj :错误LNK2001:无法解析的外部符号“公众:双__ thiscall员工:: get_salary (无效)常量” ( ? @ @ QBENXZ get_salary @雇员)
Text1.obj :错误LNK2001:无法解析的外部符号“公众: __ thiscall员工::雇员(类的std :: basic_string的<字符,结构的std :: char_traits <Char>来,类的std ::分配器<Char>来> ,双面) ” ( basic_string的? 0Employee @ @ QAE @ V ? $ @杜? $ char_traits @ D @ STD @ @ V ?
$分配器@ D @ 2 @ @ @的std @ N @ Z)
Debug/Text1.exe :致命错误LNK1120 :1无法解析的外部
执行的link.exe时出错。




魔火 发表于 2013-12-9 21:27:22

添加头文件有两种方法,一种在vc6..0选择菜单中的file-->new,在弹出的对话框中选择files选项卡,然后选择c/c++ header file.第二种方法。新建一个文本文件,取一个你想要取的名字,然后修改后缀名为.h,如果想建c文件就改为.c,想建c++文件就改为.cpp。然后再v你创建的vc工程上点击右键,在弹出菜单中选择add files to project,然后找到你刚才创建的文件就可以添加到工程中了,使用第二种方法很简便,可以快速添加多个文件到工程中。希望能帮到你

两个人 发表于 2013-12-9 22:08:25

魔火 发表于 2013-12-9 21:27 static/image/common/back.gif
添加头文件有两种方法,一种在vc6..0选择菜单中的file-->new,在弹出的对话框中选择files选项卡,然后选择c/ ...

--------------------Configuration: cmd - Win32 Debug--------------------
Compiling...
Text1.cpp
Linking...
Text1.obj : error LNK2001: unresolved external symbol "public: void __thiscall Line::move(double,double)" (?move@Line@@QAEXNN@Z)
Text1.obj : error LNK2001: unresolved external symbol "public: class GraphicWindow & __thiscall GraphicWindow::operator<<(class Line)" (??6GraphicWindow@@QAEAAV0@VLine@@@Z)
Text1.obj : error LNK2001: unresolved external symbol "class GraphicWindow cwin" (?cwin@@3VGraphicWindow@@A)
Text1.obj : error LNK2001: unresolved external symbol "public: __thiscall Line::Line(class Point,class Point)" (??0Line@@QAE@VPoint@@0@Z)
Text1.obj : error LNK2001: unresolved external symbol "public: __thiscall Point::Point(double,double)" (??0Point@@QAE@NN@Z)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/cmd.exe : fatal error LNK1120: 6 unresolved externals
执行 link.exe 时出错.

cmd.exe - 1 error(s), 0 warning(s)

--------------------配置:CMD - Win32调试--------------------
编译...
Text1.cpp
链接...
Text1.obj:错误LNK2001:无法解析的外部符号“公共语句:void __ thiscall线::移动(双,双)”(招行@@@ QAEXNN@ Z?)
Text1.obj:错误LNK2001:无法解析的外部符号“公众:类GraphicWindow&__ thiscall GraphicWindow::运算符<<(类线)”(?6GraphicWindow@@@ QAEAAV0 VLINE@@@ Z)
Text1.obj:错误LNK2001:(?CWIN@@3VGraphicWindow@@ A)解析的外部符号“类GraphicWindow CWIN”
Text1.obj:错误LNK2001:无法解析的外部符号“公众:__ thiscall线::线(Point类,类Point)”(?0Line@@ QAE@ VPOINT@@0@ Z)
Text1.obj:错误LNK2001:无法解析的外部符号“公众:__ thiscall点::点(双,双)”(0分@@ QAE@ NN@ Z?)
LIBCD.LIB(crt0.obj):错误LNK2001:无法解析的外部符号_main
调试/ cmd.exe的:致命错误LNK1120:1无法解析的外部
执行的link.exe时出错。

cmd.exe的 - 1个错误,0个警告

两个人 发表于 2013-12-9 22:09:57

魔火 发表于 2013-12-9 21:27 static/image/common/back.gif
添加头文件有两种方法,一种在vc6..0选择菜单中的file-->new,在弹出的对话框中选择files选项卡,然后选择c/ ...

按你说的,还是不行~~~~

魔火 发表于 2013-12-9 22:34:22

两个人 发表于 2013-12-9 22:08 static/image/common/back.gif
--------------------Configuration: cmd - Win32 Debug--------------------
Compiling...
Text1.cpp
...

链接错误可能是你没有实现某些类的方法,你只是声明了它,没有具体的实现

maomingkun 发表于 2013-12-11 09:20:32

添加头文件以后,还需要一些设置的 ,比如#include “自定义头文件.h”还要注意使用<>还是“”的问题
页: [1]
查看完整版本: 请教:怎样添加头文件在VC6.0里 ,怎么设置VC6.0?