首页 > 解决方案 > 您好,我阅读了大约 10 个教程,但我一直收到错误,这是我的 Makefile 文件和错误

问题描述

LNode : 链表节点

LList : 链表

Eleman:链表值类型

控制:所有主要代码

程序: main ,包含 kontrol()

g++ -I "./include" -c ./src/Program.cpp -o ./lib/Program.o
g++ ./lib/LNode.o ./lib/LListe.o ./lib/Kontrol.o ./lib/Program.o ./lib/Eleman.o -o ./bin/program
./lib/Kontrol.o:Kontrol.cpp:(.text+0x3e): undefined reference to `LListe<Eleman>::LListe()'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x1ad): undefined reference to `LListe<Eleman>::pushBack(Eleman 
const&)'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x1de): undefined reference to `LListe<Eleman>::end()'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x2fc): undefined reference to `LListe<Eleman>::pushBack(Eleman 
const&)'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x3fa): undefined reference to `LListe<Eleman>::pushBack(Eleman 
const&)'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x44e): undefined reference to `LListe<Eleman>::end()'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x587): undefined reference to `LListe<Eleman>::pushBack(Eleman 
const&)'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x68e): undefined reference to `LListe<Eleman>::pushBack(Eleman 
const&)'
./lib/Kontrol.o:Kontrol.cpp:(.text+0x711): undefined reference to `LListe<Eleman>::begin()'
collect2.exe: error: ld returned 1 exit status
Makefile:3: recipe for target 'program' failed
mingw32-make: *** [program] Error 1

标签: c++listlinked-listmakefile

解决方案


推荐阅读