1

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) 
5
  • Maybe if you post the makefile it will be easier to figure out the problem... Sep 4, 2011 at 17:12
  • The Makefile is auto generated by the IDE 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)
    – Harry
    Sep 4, 2011 at 17:22
  • Actually the htmlcxx zip file I downloaded has everything for the include path, I think I need to build the same to create the .lib or .a file but I am wondering how to do it. I downloaded the htmlcxx from sourceforge.net/projects/htmlcxx
    – Harry
    Sep 4, 2011 at 17:49
  • I'm just gonna leave this here: dev-c++. Sep 4, 2011 at 18:00
  • 1
    And since i dont thing the OP is going to read it: A horrible, outdated IDE using a horrible outdated version of the GCC compiler. Dev-C++ was buggy and lacked major features when it was last updated in 2005. The situation has not improved just because the code has gone unmodified for 6 years. It is bundled with GCC 3.4 by default, which is just as old. ** Do not use **;
    – viraj
    Sep 5, 2011 at 3:19

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.