Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello there

I made a sample C++ Win32 console application and then added a class CFileParser.

Now i add a function inside the CFileParser called OpeningInstructions() which is declared as public.

Now i include FileParser.h in the main file of the app having MAIN() function and then trying to call the function.............. and it gives an error as shown below.

Fro some reason it's not able to detect the function inside the clas CFileParser.

Any idea how to resolve this?

Thanks in advance
HTML
error LNK2019: unresolved external symbol "public: void __thiscall CFileParser::OpeningInstructions(void)" (?OpeningInstructions@CFileParser@@QAEXXZ) referenced in function _wmain
1&gt;C:\SourceCode\CodeFileParser\CodeFileParser\Debug\CodeFileParser.exe : fatal error LNK1120: 1 unr</pre>esolved externals
Posted
Updated 15-Oct-12 5:52am
v2

1 solution

"Added a class CFileParser" suggests that you've written it's code by yourself and added it to your program in the form of source code. Then it is possible that you only declared CFileParser::OpeningInstructions but not defined it. Add the definition with '{}' function body block in some *.cpp file, or, alternatively, inline the function body in your *.h file.

—SA
 
Share this answer
 
Comments
Shmuel Zang 15-Oct-12 12:05pm    
5'ed.
Sergey Alexandrovich Kryukov 15-Oct-12 13:14pm    
Thank you, Shmuel.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900