作者nimsbnims (nimsbnims)
看板C_and_CPP
标题[问题] LNK2019错误,但我没要他连结dll档
时间Fri Oct 20 18:53:19 2017
开发平台(Platform): (Ex: Win10, Linux, ...)
Win10
编译器(Ex: GCC, clang, VC++...)+目标环境(跟开发平台不同的话需列出)
VC++2017
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
无
问题(Question):
小弟目前在做学校的Double-Linked List的作业,教授提供框架叫我们把implementation写出来
之後执行教授提供的测试档时出现了LNK 2019的错误:
https://goo.gl/zog1jk
上网查了一下,普遍都是说忘记把该连结的dll档写进程式,但我这种简单的程式根本不会用到任何外来的dll档案啊QQ
而且我的错误讯息後面有乱码,感觉跟网路上的案例都不太一样。
想请问有人知道要怎麽解决吗QQ
喂入的资料(Input):
预期的正确结果(Expected Output):
错误结果(Wrong Output):
1>------ 已开始建置: 专案: DoubleLinkedList, 组态: Debug Win32 ------
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall DList<int>::DList<int>(void)" (??0?$DList@H@@QAE@XZ) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: bool __thiscall DList<int>::isEmpty(void)" (?isEmpty@?$DList@H@@QAE_NXZ) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: int __thiscall DList<int>::length(void)" (?length@?$DList@H@@QAEHXZ) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall DList<int>::insertFront(int const &)" (?insertFront@?$DList@H@@QAEXABH@Z) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall DList<int>::insertBack(int const &)" (?insertBack@?$DList@H@@QAEXABH@Z) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: class DListNode<int> * __thiscall DList<int>::front(void)" (?front@?$DList@H@@QAEPAV?$DListNode@H@@XZ) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: class DListNode<int> * __thiscall DList<int>::back(void)" (?back@?$DList@H@@QAEPAV?$DListNode@H@@XZ) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: class DListNode<int> * __thiscall DList<int>::next(class DListNode<int> *)" (?next@?$DList@H@@QAEPAV?$DListNode@H@@PAV2@@Z) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: class DListNode<int> * __thiscall DList<int>::prev(class DListNode<int> *)" (?prev@?$DList@H@@QAEPAV?$DListNode@H@@PAV2@@Z) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall DList<int>::insertAfter(int const &,class DListNode<int> *)" (?insertAfter@?$DList@H@@QAEXABHPAV?$DListNode@H@@@Z) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall DList<int>::insertBefore(int const &,class DListNode<int> *)" (?insertBefore@?$DList@H@@QAEXABHPAV?$DListNode@H@@@Z) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall DList<int>::remove(class DListNode<int> *)" (?remove@?$DList@H@@QAEXPAV?$DListNode@H@@@Z) 在函式 _main 中被参考
1>DoubleLinkedList.obj : error LNK2019: 无法解析的外部符号 "public: void __thiscall DList<int>::toString(void)" (?toString@?$DList@H@@QAEXXZ) 在函式 _main 中被参考
1>D:\Documents\GoogleDrive.infinite.r06\资料结构作业\HW3\DoubleLinkedList\Debug\DoubleLinkedList.exe : fatal error LNK1120: 13 个无法解析的外部符号
1>专案 "DoubleLinkedList.vcxproj" 建置完成 -- 失败。
========== 建置: 0 成功、1 失败、0 最新、0 略过 ==========
程式码(Code):(请善用置底文网页, 记得排版)
程式码与错误讯息:
http://goo.gl/pcZ8ao
各档案大概如下:
DList.h.txt:提供double-linked list的控制项
DList.cpp:DList.h的implementation
DListNode.h.txt:每个node
DListNode.cpp.txt:node的implementation
DoubleLinkedList.cpp.txt:测试的主程式码
补充说明(Supplement):
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.112.25.99
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_and_CPP/M.1508496802.A.DFA.html
1F:→ longlongint: 甚麽是 DList ? 10/20 19:06
2F:推 jerryh001: 有template的class宣告和定义不能分开 10/20 19:09
3F:→ Hazukashiine: 这周串列周? 10/20 19:10
4F:→ chengcti: 可以提供整个专案档吗 有可能设定错误 10/20 19:18
5F:推 damody: 推2楼 10/20 19:22
6F:→ nimsbnims: @longlongint 就是用来指向sentinel和提供node删减的类 10/20 20:03
7F:→ nimsbnims: @jerryh001 请问这是什麽意思QQ 10/20 20:04
8F:→ nimsbnims: @chengcti 好,我放在同一个google资料夹下了 10/20 20:04
10F:→ nimsbnims: @感谢jerryh001大大,我把所有实作都写在h就好了Orz 10/20 20:24
11F:→ moebear: 你程式码连结我点进去叫我跟你拿权限== 10/21 03:02
12F:→ nimsbnims: 抱歉,後来解决了我就把权限关闭了,解决方法後来是直 10/28 19:07
13F:→ nimsbnims: 接把实作都写入h档,或是改用codeblock 10/28 19:07