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

Error C2491 definition of dllimport static data member not allowed #5

Closed fverneau closed 11 months ago

fverneau commented 11 months ago

Good morning, Compiling QAzureStorageRestApi on Qt 6.4 with MSVC2019 64-bit, I get an error "Error C2491 definition of dllimport static data member not allowed" in file "AzureStorage\QAzureStorageRestApi.cpp" on line 61 :

`Q_CONSTINIT const QMetaObject QAzureStorageRestApi::staticMetaObject = { { QMetaObject::SuperData::link(), qt_meta_stringdata_QAzureStorageRestApi.offsetsAndSizes, qt_meta_data_QAzureStorageRestApi, qt_static_metacall, nullptr, qt_incomplete_metaTypeArray<qt_meta_stringdata_QAzureStorageRestApi_t, // Q_OBJECT / Q_GADGET QtPrivate::TypeAndForceComplete<QAzureStorageRestApi, std::true_type>

, nullptr } }; `

QuentinCG commented 11 months ago

This should not happen with pro file in this repository.

In your library pro file, do you have this (like in lib in this repo) ?

DEFINES += QAZURESTORAGERESTAPI_LIBRARY ... HEADERS += \ include/QAzureStorageRestApi.h \ include/QAzureStorageRestApi_global.h

https://github.com/QuentinCG/QAzureStorageRestApi/blob/master/lib/lib.pro#L6

fverneau commented 11 months ago

I add DEFINES += QAZURESTORAGERESTAPI_LIBRARY in the .PRO and its OK. The error C2491 disappeared.