473,396 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

error LNK2019: unresolved external symbol

I tried to figure out myself but still can't figure out,
Basically there is two file, main.cpp, ParserDom.h. The ParserDom.h was located in the "html" folder which located same place as main.cpp
But when I compiled, I get error LNK2019: unresolved external symbol
which all of them referring to member function of ParserDom class. Can anyone figure out ?
I always get this kind of problem, can anyone give me some tips what is the causes and how can I avoid it in future ?
Thank you. The code was taken from http://htmlcxx.sourceforge.net/

using Visual Studion 2005

main.cpp file
Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. #include <string>
  3. #include "html/ParserDom.h"
  4.  
  5. using namespace std;
  6. using namespace htmlcxx;
  7.  
  8.  
  9. int main()
  10. {
  11.     string html = "<html><body>hey</body></html>";
  12.     HTML::ParserDom parser;
  13.     tree<HTML::Node> dom = parser.parseTree(html);
  14.     return 0;
  15. }
ParserDom.h header file
Expand|Select|Wrap|Line Numbers
  1. #ifndef __HTML_PARSER_DOM_H__
  2. #define __HTML_PARSER_DOM_H__
  3.  
  4. #include "ParserSax.h"
  5. #include "tree.h"
  6.  
  7. namespace htmlcxx
  8. {
  9.     namespace HTML
  10.     {
  11.         class ParserDom : public ParserSax
  12.         {
  13.             public:
  14.                 ParserDom() {}
  15.                 ~ParserDom() {}
  16.  
  17.                 const tree<Node> &parseTree(const std::string &html);
  18.                 const tree<Node> &getTree()
  19.                 { return mHtmlTree; }
  20.  
  21.             protected:
  22.                 virtual void beginParsing();
  23.  
  24.                 virtual void foundTag(Node node, bool isEnd);
  25.                 virtual void foundText(Node node);
  26.                 virtual void foundComment(Node node);
  27.  
  28.                 virtual void endParsing();
  29.  
  30.                 tree<Node> mHtmlTree;
  31.                 tree<Node>::iterator mCurrentState;
  32.         };
  33.  
  34.         std::ostream &operator<<(std::ostream &stream, const tree<HTML::Node> &tr);
  35.     } //namespace HTML
  36. } //namespace htmlcxx
  37.  
  38. #endif
  39.  
Aug 2 '07 #1
7 3534
JosAH
11,448 Expert 8TB
I think you simply forgot to link against a library that actually contains the compiled
definition of that ParserDom class. What do the docs say?

kind regards,

Jos
Aug 2 '07 #2
Thanks for the reply, really appreciate that. The project can be downloaded here http://sf.net/projects/htmlcxx
I guess, I have to install first, which I have not done yet, I saw those MakeFile which I encounter very often but have not yet know how to use it. I need to run the config file but what kind of shell i need to run ? can give a very brief instruction ? Thank you.
Aug 2 '07 #3
JosAH
11,448 Expert 8TB
Thanks for the reply, really appreciate that. The project can be downloaded here http://sf.net/projects/htmlcxx
I guess, I have to install first, which I have not done yet,
That explains the unresolved external that your linker encounterd.

I saw those MakeFile which I encounter very often but have not yet know how to
use it. I need to run the config file but what kind of shell i need to run ? can give
a very brief instruction ? Thank you.
This is what I read from that download page:
Operating System: All POSIX (Linux/BSD/UNIX-like OSes), Linux

so, at least you should have cygwin or equivalent running if you're using a Windows
machine. Otherwise, simply run the configuration (just type in "make").
Most (if not all) proper Unix/Linux projects try to figure out what's available on
your system and they use that or they bail out if the project can't run on your
system. That's what the configuration part does. Most of the time it compiles
and installs the libraries and all the other stuff for you. If you're lucky these
projects even come with a proper manual ;-)

kind regards,

Jos
Aug 2 '07 #4
Thanks, I am using windows, so now I am using cywin for my very first time, change my directory to the sources file with "cd [DIRECTORY]" , after that I type "configure", gives command not found, can give me a little hint on running the configure in cywin, if you don't mind ? Really2 thank you.
Aug 2 '07 #5
Thanks, finally I get it to work, when I create header file and copy it from htmlcxx source file manually to include into my project. I don't use the configure or makefile at all, It works so graceful. Thanks.
Aug 2 '07 #6
JosAH
11,448 Expert 8TB
Thanks, finally I get it to work, when I create header file and copy it from htmlcxx source file manually to include into my project. I don't use the configure or makefile at all, It works so graceful. Thanks.
Hm, you're not supposed to scrape the bits and pieces from another project's
source and header files each time you want to use something. btw, you typed
'configure'; what happens if/when you just type 'make'? There should be a clean
way to install that project on your machine. Any manual pages mayhap?

kind regards,

Jos
Aug 2 '07 #7
RRick
463 Expert 256MB
With Unix installations there are usually several steps to follow.

First check for an INSTALL or README file at the top source directory. This might have tips for your platform.

If one exists in the source directory, run the configure script. Sometimes the PATH variable is touchy and you need to run >> ./configure. This checks the system and can set up the makefiles for you.

If configure is successful, then run >> make.

After that, run >> make install. This will install the various parts of the program, usually to /usr/local/xxx.
Aug 3 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Vishal Saxena | last post by:
Hi, I am new to this news group, hope to get prompt solution from you, gurus of VC. Well i had a project developed in VC++ 6.0, it uses Adobe Plugin Development SDK, I am trying to upgrade my...
4
by: Jun | last post by:
anyone know how this error shows? how can i solve this? LINK : error LNK2020: unresolved token (0A0000EA) _AtlBaseModule LINK : error LNK2020: unresolved token (0A0000EC) atlTraceGeneral LINK :...
0
by: Usman | last post by:
Hi I've a COM compiled in visual studio 6 that is internally using zlib library (an opensource library for compression). I've no problem compiling that code. But when I moved to visual...
4
by: Sanjay Kumar | last post by:
Folks ! I am working with VC++ after a long time and having problem linking latest xerces 2.7 in VC++ 2005 Express Edition. I have done following: 1. downloaded and unpacked the the...
1
by: developer | last post by:
Hi All I have made a .NET project. the files included are borland c++ files that i am migrate to VC++ .NET I am using Microsoft Visual C++ .NET 2003. the compilation goes through properly,...
5
by: eberesche | last post by:
Hello, as a novice in ASN.1 I have me to a project in C ++ under use of ASN.1 - structures risquély. One of my colleagues means, this would deal something with masochism ;-). Result should be a DLL...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
4
by: jk2l | last post by:
Error 10 error LNK2019: unresolved external symbol __imp__glBindTexture@8 referenced in function "public: void __thiscall GLTexture::Use(void)" (?Use@GLTexture@@QAEXXZ) GLTexture.obj Error 11 error...
0
by: Ling | last post by:
I am using boost.python to wrap C++ function which includes directmusic libraries to simply play the midi, but lots of linkage errors "error LNK2001: unresolved external symbol". I wonder if it is...
2
by: hjazz | last post by:
Hi all, I'm new to VS, and I'm using Visual Studio .NET 2003. I'm trying to write a program which uses pcap libraries. However, I keep getting the following errors: error LNK2019: unresolved...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.