preface

First of all, the error is a link, not a bug , The root cause of this problem is to find the function declaration , But the implementation of the function was not found , This is fundamental , There are many specific forms of expression , We'll analyze it later , Let's take a look at this question I've been looking up all afternoon .

problem analysis

Because something like this happened before , I've worked it out , So when I saw this problem, I decided it at once , The implementation of the function is not found , The most common occurrence of this phenomenon is that the project does not cpp File included , I went back and forth several times , The discovery is not the problem , So I annotated out the original complex class , And I wrote a very simple class implementation , The result is the same mistake , This is strange .

Let's talk about engineering first , The solution for this project was generated by me with tools , I just added the problem item , I checked the engineering configuration and found that there was no difference between them , So I tried to add the new files to the original project , Found compilation successful , This shows that it is still a problem of engineering configuration , So I checked the path , It's all right , And the library file of the new project is also generated in the shared library directory .

In such a search, finally found the problem , The original library file of the new project is generated , But it's not linked to exe in , I left out the name of the library file , If this is VS In general, I will add , But it's hard to notice in the configuration file , Finally, add the missing library file .

summary

* This is a connection error .
* The root cause of this problem is that there is a function declaration but no function implementation .
* There are several common cases of this problem :

* Containing function implementation cpp The file was not added to the project .
* The generated library file is not linked to exe Executable file .

Technology