eclipse-paho / eclipse-paho/paho.mqtt.cpp
Base64TestOpenSSL giving problem and how to use only paho-mqtt3as libraray project in visual studio
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
Firstly I am on Windows and Visual studio 2022
I successfully build paho c library using cmake with providing openssl.
But now when I open the solution in visual studio and set the Base64TestOpenSSL as startup project then it is giving me following error
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) Base64TestOpenSSL C:\Windows\System32\paho.mqtt.c\build\src\MSVCRTD.lib(exe_main.obj) 1
My main motive is to use paho-mqtt3as project in with my visual studio project so when I did this and
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol OPENSSL_init_crypto referenced in function SSLSocket_initialize mqtt_subscriber E:\SAMAN\mqtt_subscriber\mqtt_subscriber\paho-mqtt3as-static.lib(SSLSocket.obj) 1
and many errors like this related to openssl
please can you tell me step by step that how will I use the paho-mqtt3as visual studio project with my another project in visual studio

I want to do above and I am getting this error

please be in mind that I am new to it so give me each step if you can.
Contributor guide
Research direction
Start with the CMake-generated Visual Studio solution and the Base64TestOpenSSL startup project, then inspect the linker configuration for mqtt_subscriber and paho-mqtt3as-static.lib. Reproduce the reported unresolved main and OPENSSL_init_crypto errors; done means the example and the separate Visual Studio project link successfully with the required dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100