我有一个使用htmlcxx的小程序,但是当我尝试构建代码时,它会给出链接器错误 . 我刚刚下载了htmlcxx.084.zip,解压缩并将其放在Dev-Cpp \ include \ c \ 3.4.2 \ htmlcxx中 . 代码不会给出任何构建错误,但链接失败 .
[Linker error] undefined reference to `htmlcxx::HTML::ParserDom::parseTree(std::string const&)'
[Linker error] undefined reference to `htmlcxx::HTML::operator<<(std::ostream&, tree<htmlcxx::HTML::Node, std::allocator<tree_node_<htmlcxx::HTML::Node> > > const&)'
[Linker error] undefined reference to `htmlcxx::HTML::Node::parseAttributes()'
[Linker error] undefined reference to `vtable for htmlcxx::HTML::ParserDom'
ld returned 1 exit status
[Build Error] [test.exe] Error 1
我在Makefile中遗漏了什么,或者lib路径中缺少某些内容 .
CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
OBJ = tree_test.o $(RES)
LINKOBJ = tree_test.o $(RES)
LIBS = -L"C:/Dev-Cpp/lib" -lwinmm -lgdi32
INCS = -I"C:/Dev-Cpp/include"
CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
BIN = test.exe
CXXFLAGS = $(CXXINCS)
CFLAGS = $(INCS)
RM = rm -f
$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "test.exe" $(LIBS)