-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unresolved external symbol "private: static struct MQTTAsync_createOptions const mqtt::create_options::DFLT_C_STRUCT" #304
Comments
OK. Thanks. I haven't tried this on Windows yet. I'll have a look and get it fixed. |
I have the same problem, on windows too.
|
I just tried this and it worked for me. So I'm not seeing the problem. The missing struct is (the only thing) defined in The source file is included in CMake: And when I run CMake, the source file is listed in the
Sorry, I'm not much of a Windows programmer. Do you have any ideas? Are all these present on your local machines? |
Has this been resolved? |
For my application i made a workaround, since everything compiles good but something wrong happends when using mqtt.cpp inside my application.
with this:
Obviously this solution is good just for me since i wanted to send messages while disconnected. Have you changed/fixed something? Because i can try to update the sources and try to recompile. |
src\mqtt\create_options.h The DFLT_C_STRUCT problem of line 58 , I am modifying the 40 line “MQTTAsync_createOptions DFLT_C_STRUCT = MQTTAsync_createOptions_initializer;” and deleting "create"_ options.cpp "24 line const MQTTAsync_createOptions create_options::DFLT_C_STRUCT = MQTTAsync_createOptions_initializer; |
Hi, sorry for not posting again, this issue was related to a client PC which I lost access. I think we workarounded it using another version of VScode. Later I tried again in another system with VScode 2019 and it worked, the only difference I can think of was the system localization being the one who works USA english and the broken one SPAIN spanish I dont know how this could be related but I have faced problems in VScode with other libs bc of this. |
I just got the same problem when installing 1.2.0 from Vcpkg and using VS19 16.9.3. Building the library works just fine but whenever I use the |
I retried it today, with updated source of mqtt and mqtccpp. |
With this solution it works. |
I have encountered the same problem with Visual Studio 2019 for 2 projects: unit_tests and async_public_time. Obviously, the 2 projects are less the input library paho-cpp-objs.lib. After adding the paho-cpp-objs.lib, 2 projects are built successfully. Additional, unit_tests project required use C++20 language to build. Hope the developer modify the configure file of CMake for the above information. |
The issue is still reproduced, in my case helped moving ctor from src\mqtt\create_options.h to cpp file:
|
^^^ OK. I will do what @artemiuzzz suggests and move the constructor out of the header file and into the .cpp file. |
I assume the update fixes it for everyone. It not, please feel free to reopen this issue. |
Compiling latest paho cpp with the latest paho c (installed without errors), with visual code 2019 for windows 10 results in:
LNK2019 unresolved external symbol "private: static struct MQTTAsync_createOptions const mqtt::create_options::DFLT_C_STRUCT" (?DFLT_C_STRUCT@create_options@mqtt@@0UMQTTAsync_createOptions@@b) referenced in function main async_publish_time C:\Users\Usuario\Desktop\VDB\dependencias\paho.mqtt.cpp\build\src\samples\async_publish_time.obj
at the compilation of Project: rpc_math_srvr, Configuration: Release x64
All was build as Readme says, it does not work either compiling from VS gui or powershell.
Thanks you for this library, amazing work, I used it a lot recently ^^
VS compile output [edited, more readable]
The text was updated successfully, but these errors were encountered: