Qt Creator – LNK 2019: Unresolved external symbol – Fast Trick

qt unresolved externals how to fix

The Qt c++ error LNK 2019: Unresolved external symbol often appear because the library that you try use in your program are not correctly linked to your program. This error is not hard to solve but now I will give you a trick which will help you to solve LNK 2019: Unresolved external symbol on Qt Creator.

 

What is the cause of LNK 2019: Unresolved external symbol?

For example in your program you try to use a library from the internet. For example cURL library.

Is not enough to copy include folder (from cURL) in your compiler include folder and then use it in your program with #include <example/example.h> . When you will call a function from the respective header you will get  LNK 2019: Unresolved external symbol. So, you will need to include the lib dependency

There you will find an article which will explain you how to add libs to your qmake:
qt-project.org/doc/qtcreator-2.6/creator-project-qmake-libraries.html

However after you add libs to your qmake the risk to get again LNK 2019: Unresolved external symbol will persist read the following trick and if you included correctly libs your application will work property.

How to solve LNK 2019: Unresolved external symbol

Open your project on qt creator >> go to your project >> right-click on the project >> Clean:

qt project clean project

Now again right-click on the project >> Click on Run qmake:

qt creator run qmake

Now go again>> right-click on the project and then click on Rebuild:

rebuild project on qt creator

Now you can run your qt application.

If you get again LNK 2019: Unresolved external symbol error then you have not included libs correctly or the libs are not compiled with the same compiler from Qt creator and you will have to compile libs with the same compiles you are using on Qt Creator and then include libs and will work.

Conclusion

You are now knowing how to fix LNK 2019: Unresolved external symbol error on Qt Creator and you are knowing from where this error is coming.

Something unclear? Comment >> Ask << Get respond

Related posts:

2 Comments on "Qt Creator – LNK 2019: Unresolved external symbol – Fast Trick"

  1. Johna284 says:

    Excellent post. I was checking continuously this blog and I’m impressed! Extremely useful information specially the last part.

Trackbacks for this post

  1. Fast trick - During startup program exited with code 0xc* | How to Fix

Got something to say? Go for it!