Closed joshorenberg closed 1 year ago
Assuming that Boost and OpenSSL are correctly installed, here is the command from the Developer Command Prompt for VS which I use:
c:\mailio\build>c:\Bin\cmake-3.17.3\bin\cmake.exe -DBOOST_ROOT=c:\Install\boost_1_71_0 -DOPENSSL_ROOT_DIR=c:\bin\OpenSSL-Win64 ..
The mailio.sln
file is generated which can be opened from VS to build the solution.
Awesome thanks karastojko. I used Visual Studio CMake and the Visual Studio IDE and was able to build the project successfully. I scrapped using Qt Creator for the build it was more trouble than it's worth. I'm using Qt Creator however for my project and might switch some other time but not now. It shouldn't be a problem to use it with your libraries and code right? Right now I am getting undeclared identifier for message msg in the smtps_simple_msg.cpp example. When I try to build I get:
C:\Users\Josh\Documents\program stuff\mailio\include\mailio\message.hpp:29: error: C1083: Cannot open include file: 'boost/date_time.hpp': No such file or directory
for the line
#include <boost/date_time.hpp>
I tried manually fixing things but there's got to be something I'm doing wrong. For some reason it's not pointing to the boost headers. Any ideas why that might be? Thanks!
Actually got a little further, added INCLUDEPATH += C:\boost_1_80_0 to the Qt project file. Then had to add INCLUDEPATH += "C:\Users\Josh\Documents\program stuff\mailio". Then I had to put
#include <mailio/include/mailio/message.hpp>
#include <mailio/include/mailio/smtp.hpp>
using mailio::message;
using mailio::mail_address;
using mailio::smtps;
using mailio::smtp_error;
using mailio::dialog_error;
using std::cout;
using std::endl;
before including windows.h in another part of my program some silly error from order of include statements. I was getting this error before changing the order of includes:
C:\boost_1_80_0\boost\asio\detail\socket_types.hpp:24: error: C1189: #error: WinSock.h has already been included
I am stuck at another point in the code. I used #define WIN32_LEAN_AND_MEAN to fix the Winsock.h already included error however I still get the error. I also tried including the mailio libraries before windows.h to fix the error as well. See here for more about the error. Before it occurred 5 times, after these modifications it occurs once. I include windows.h 4 times in my code so I think the cause of the error comes from somewhere outside of my code. You don't use the Win API at all in your library do you? I think there might be a redundant include somewhere in your code causing the error. Can you try on your end? I'll try using Visual Studio for the smtps_simple_msg.cpp example project when I have time it's just not working right now. I'm using the code straight out of smtps_simple_msg.cpp example. Thanks for the help :) I'm so close I can feel it.
mailio does not use WinAPI directly but Boost.Asio definitely uses it. I do not use Qt Creator now, but I did in the past on Linux and I had no problems with Gcc. Do you use MinGW or MSVC together with Qt Creator?
I am using MSVC 2019. I can create a project from scratch with your sample code when I have time but not sure when that would be...
Hi I've tried a million things to fix this problem. I get the following error message when running CMake:
C:\Qt\Tools\CMake_64\share\cmake-3.19\Modules\FindPackageHandleStandardArgs.cmake:218: error: Could NOT find Boost (missing: Boost_INCLUDE_DIR system date_time regex) C:/Qt/Tools/CMake_64/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE) C:/Qt/Tools/CMake_64/share/cmake-3.19/Modules/FindBoost.cmake:2193 (find_package_handle_standard_args) CMakeLists.txt:70 (find_package)
I tried setting the PATH environment variable to include both C:\boost_1_80_0\stage\lib and C:\boost_1_80_0\boost. I tried passing
-DBOOST_ROOT=C:\boost_1_80_0 -DBOOST_INCLUDE_DIR=C:\boost_1_80_0\boost -DBOOST_LIBRARYDIR=C:\boost_1_80_0\stage\lib -DOPENSSL_ROOT_DIR=C:\OpenSSL-VC-64
as CMake arguments both with and without the =s. I then added the following line to CMakeLists.txt: SET(Boost_INCLUDE_DIR ${Boost_INCLUDE_DIR} "C:/boost_1_80_0"). I then got a little further but then get this error message:I tried adding SET(BOOST_ROOT ${BOOST_ROOT} "C:/boost_1_80_0") to CMakeLists.txt with no luck.
I also added
to CMakeLists.txt with no luck.
I'm ready to throw my computer out the window. What am I doing wrong? Also I built Boost with the PATH variable including C:\OpenSSL-VC-64\include\openssl and C:\OpenSSL-VC-64\lib. Thanks!