Linking error while using htmlcxx with dev-cpp

旧巷老猫 提交于 2019-12-11 06:23:19

问题


I have small program using htmlcxx but when I try building the code it gives linker error. I just downloaded the htmlcxx.084.zip, unzipped it and placed it in Dev-Cpp\include\c++\3.4.2\htmlcxx. The code does not give any build error but the linking fails.

[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 

Am I missing something in the Makefile or the something is missing in the lib path.?

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) 

来源:https://stackoverflow.com/questions/7300828/linking-error-while-using-htmlcxx-with-dev-cpp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!