V
V
VitaliiUA2019-01-24 18:02:25
C++ / C#
VitaliiUA, 2019-01-24 18:02:25

Google test linking error, how to fix?

I have created a project in which there is a class that needs to be tested, I created a GoogleTest project, added a link to the project with the class, and I got errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "public: __thiscall tinyxml2::XMLDocument::XMLDocument(bool,enum tinyxml2::Whitespace)" ([email protected]@@[email protected][email protected]@@Z) referenced in function "public: __thiscall Primes::Primes(void)" ([email protected]@[email protected])	Tests	C:\Users\usera\Desktop\Task_Krasokha_Vitalii\Tests\test.obj	1

How to fix it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-01-24
@jcmvbkbc

unresolved external symbol
"public: __thiscall tinyxml2::XMLDocument::XMLDocument(bool,enum tinyxml2::Whitespace)"
referenced in function
"public: __thiscall Primes::Primes(void)"

How to fix it

If Primes is your class and tinyxml2 is the library it uses, then you need to link the GoogleTest project with that library.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question