QuentinCG / QAzureStorageRestApi

[Done] Standalone Azure Storage REST API client for Qt5+ & Qt6+ (Tested with Qt 5.12.12 & Qt 6.2.3)
MIT License
2 stars 4 forks source link

LNK2019: unresolved external symbol #6

Closed fverneau closed 11 months ago

fverneau commented 11 months ago

Good evening, I'm trying to compile a console application using QAzureStorageRestAPI, but I get the following error message: main.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl QAzureStorageRestApi::QAzureStorageRestApi(class QString const &,class QString const &,class QObject *)" (??0QAzureStorageRestApi@@QEAA@AEBVQString @@0PEAVQObject@@@Z) reference in the main function The .LIB and .DLL are placed at the same level as the .PRO in my project.

fverneau commented 11 months ago

I've added this line in the .PRO LIBS += ".\QAzureStorageRestApi.lib" It's OK

fverneau commented 11 months ago

In the Projects view, right-click the project name to open the context menu and select Add Library. I have stored the QAzureStorageRestApi.lib file in .\AzureStorage in my project. The lines below have been added :

win32: LIBS += -L$$PWD/AzureStorage/ -lQAzureStorageRestApi INCLUDEPATH += $$PWD/AzureStorage DEPENDPATH += $$PWD/AzureStorage

QuentinCG commented 11 months ago

Yes, you have an example on how to include the library in your project depending on the lib here: https://github.com/QuentinCG/QAzureStorageRestApi/blob/master/example/example.pro

Be careful, you are handling only release with your example. Put the lib in debug and release in separate folder if you want to handle it on all modes:

win32: { CONFIG(release, debug|release): LIBS += -L$$PWD/AzureStorage/release/ -lQAzureStorageRestApi else:CONFIG(debug, debug|release): LIBS += -L$$PWD/AzureStorage/debug/ -lQAzureStorageRestApid }