-2

I have a problem of LNK2019 when I use a function of a folder in another folder of the project.

I have a project that has two folders a and b. b uses an existing function in folder a.

I have the error LNK2019: unresolved external symbol "public: void __cdecl

enter image description here

How can i solve this problem ?

Some programmer dude
  • 380,411
  • 33
  • 383
  • 585
SADL
  • 29
  • 2
  • Is it a single project with two directories containing source files? Or two projects in separate directories? – Some programmer dude May 09 '22 at 06:34
  • I have a single project with two directories – SADL May 09 '22 at 06:49
  • Can you please copy-paste (as text) the full and complete build output? What function is the linker complaining about? Is it really defined (implemented) in the `Class2.cpp` source file (I assume)? And also please try to create a [mre] of the code itself to show us. – Some programmer dude May 09 '22 at 07:01
  • Here the error: 1>Class2.obj : error LNK2019: symbole externe non résolu "public: void __cdecl Class1::func1(struct sqlite3_stmt *,char const *)const " (?func1@Class1@QEBAXPEAUsqlite3_stmt@@PEBD@Z) référencé dans la fonction "private: void __cdecl Class2::func2(void)const " (?func2@Class2@AEBAXXZ) – SADL May 09 '22 at 07:55
  • Yes I defined #include "Class1.h" in Class2 – SADL May 09 '22 at 07:58
  • Please [edit] your question to include the error message and the [mre]. And including a header file doesn't automatically mean you're building with other source files. – Some programmer dude May 09 '22 at 08:02
  • I solved the problem by adding include – SADL May 10 '22 at 06:15
  • With the information posted in the question, there's just no way we could have helped you solve the problem that way. Please take some time to refresh [the help pages](http://stackoverflow.com/help), take the SO [tour], read [ask], as well as [this question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – Some programmer dude May 11 '22 at 05:21

0 Answers0