Issues using POCO with OpenSSL to send SMTP email - c++

This is my first time writing a program that has any interaction with email. As such, I simply want a program that when ran, sends an email. After some googling I have found that POCO is a simple library that allows me to do just that.
I would prefer to use C++.
I downloaded the latest version of POCO and included the library as well as the include folders in VS2015 Community on Windows 10. I set up a program just like the one found at this tutorial: https://axistasoft.com/blog/poco/poco-net/item/sending-email-messages-using-poco-securestreamsocket-securesmtpclientsession-class
However, when I compile the program I receive the error:
1>d:\downloads\openssl-1.1.0c\openssl-1.1.0c\include\openssl\e_os2.h(13): fatal error C1083: Cannot open include file: 'openssl/opensslconf.h': No such file or directory
So when I navigate to the folder that is named, I find a filed named 'opensslconf.h.in' - close to the file it is looking for. I'm not really sure what else to do here. This is my first time using POCO. I tried to use a simpler version with no OpenSSL but I do not believe it is possible to send email through GMail without it.
I have researched the errors but they either say that I just need to remove OpenSSL (can't do that) or some things specific to Unix, which I'm on windows.
Any ideas?

You can add it as an include folder, like -I D:\Path\To\Include\OpenSSL as a compiler argument or add it in your VS project in project settings.

Related

Unable To Locate or Access 'System.Data.Common' CLR C++ Winforms Project

I'm having an issue where I can run and use a compiled version of my project on my computer, but the moment i put the release onto another computer to run it pops up with a console for a split second saying it can't open System.Data.Common. I'm using .Net Version 4.7.2 and this is installed exactly the same on my other computer. I've even tried install VS on that one to compile the program from source code and it still doesn't work. I've checked the file it is getting the System.Data.Common.dll from and it is there and installed in the correct folder. I've tried removing it from the project through the project file and config file and I still get the same thing. It just seems to be the one dependency it is messing up for. I don't have a direct screen shot of the error since it is on another computer I was testing for but it just says that error and then says line 9 of login.cpp and that is just opening the form. Although System.Data is a necessary package for my project (since I need Data Tables), I do not use anything from System.Data.Common so if there is a way i can get it to not be considered on compilation other than the methods I've already tried, that will work too.
I have tried to remove the dependency from the vcxproj file and vcxproj.filters file. This did not work. I tried reinstalling .Net 4.7.2 on the computer I wanted to install it on. I've also tried removing the dependency from the exe.config file and none of these have worked. My last resort it to just straight up copy and paste all the code into a fresh project and keep going until I get the same error.

How do I download and install the Qt library?

I want to use the QDirIterator Class for a University Project in Visual Studio, but for some reason I just can't include it. I tried downloading the libary somewhere but couldn't find the right website, the QT website itself seems to be a messy jungle of paywalls.
The error message Visual Studio gives me is 'cannot open source file "QDirIterator"'. I have some Python knowledge so maybe I can do something similar like pip install?
https://doc.qt.io/qt-5.14/qdiriterator.html link to the documentation of the class I'm trying to use.
I feel your pain, the Qt website is very hard to navigate. This is how I installed it. Open this link and hit "qt-unified-windows-x86-online.exe." (or the correct one for your operating system). Open the file and follow the steps. I would actually recommend you find a simpler library for your single needs because AFAIK you aren't going to use 99% of the libraries that come with Qt.

How Can I Fix This LNK1104 Error in Visual Studio?

First off, allow me to give you some background. I'm attempting to emulate a game from my childhood. A lot of work has been done with respect to emulating said game, and I've made some decent progress through the windows setup guide that can be found here.
I recommend taking a look at that first, because knowing the prior steps I've done will probably help in answering this.
Currently I'm on step 10, building the Vana solution. When I build it in Visual Studio 2019, I encounter 3 errors. The login, channel, and world server projects cannot open “libmysql.lib”. The output is as follows:
LINK : fatal error LNK1104: cannot open file 'libmysql.lib'
And under the error list it reads:
LNK1104 cannot open file 'libmysql.lib'
It’s not telling me why it cannot open it, it just says that it can’t open it. It’s not giving me any location, or much clues as to what exactly I should do. I found “libmysql.lib” within the MySQL server community 8 folder and I put the file within the SQL folder in the “LazurBeemz” directory, but got the same error.
I then tried putting it into the MySQL server 5.0 folder because that’s where I pointed the “LazurBeemz” pack to, unfortunately I got the same exact errors. Honestly I have no idea where exactly I should put it or why I’m getting these errors. It’s beyond me. I checked the specifics of the error code (LNK1104), and it has a PLETHORA of possibilities. The main thing I need to know is WHERE should this file go?
Any Thoughts?
Here is a picture of the error messages
First, you need to find out the file directory where the libmysql.lib is located.
Then, you could select Properties->Linker->General->Additional Library Directories-><Edit...> and add libmysql.lib file storage directory.
Finally, you could select Properties->Linker->Input->Additional Dependencies and add the name of libmysql.lib.
Note: You need to perform similar operations on debug version and release version.

libcurl on windows

I am writing a C++ application that needs to use libcurl with HTTPS support. I already built the basic libcurl without any problem. However I have spent over 10 hours on compiling the HTTPS version, I've tried building it with VS2008, I've tried with mingw32 and I've tried with nmake. I have read about every post there is on the subject and nothing seems to work on my computer.
My question is the following : Since I use the curl lib without modifications, Is there anywhere I can find a package containing : libcurl.lib, libcurl.dll, and all the necessary dlls (ssl,zlib, libeay32,etc) to include them in my project and never worry about compilation ever again??
The lib absolutely needs to have SSL support.
Thanks
David

C++ Logging Library Setup

I've been trying for about 2 weeks now to get a logging library to work with. I've tried Log4cxx, Log4cpp, log4cplus and boost.log. The problem isn't that none of these work for me, it's that I can't figure out how to get them to work at all. I would really like to use log4cxx since I'm working with log4j/logback at work, but I haven't been able to get any of the libraries based on log4j to build. I've been able to build and use the boost library, but boost.log gives me all kinds of linker errors no matter what I try. If anyone could direct me to a step-by-step guide to get one of these libraries working I would greatly appreciate it. Also, I'm using eclipse as my IDE if that matters.
Did you ever get this working? Log4cxx definitely works on Win7. Maybe you could post some of your build errors. Just guessing, perhaps you didn't configure your eclipse project to link with a log4cxx static lib.
Boost.Log works for me quite well (Linux and Windows). It is not a header only library, there is a compiled part that you need to link against. See instructions here.
It also depends on other, non-header, Boost libraries:
The logging library uses several other Boost libraries that need
building too. These are Boost.Filesystem, Boost.System,
Boost.DateTime, Boost.Thread and Boost.Regex. Refer to their
documentation for detailed instructions on the building procedure.
Depending on your platform there may be pre-built versions of the Boost libraries. Otherwise building it yourself is straightforward if you follow the instructions. If you get stuck update your question with where exactly you got stuck and what you're seeing.
I'd recommend Pantheios. It takes some time to build everything when you first download - type make build test and go have lunch - and you have to select the output streams (Pantheios calls them "back ends") at link time, but for coding, it is really simple, e.g.
std::string name;
int age;
pantheios::log_DEBUG("name=", name, " age=", pantheios::integer(age));
It's designed from the ground up for speed - the age won't be converted into a string unless the "DEBUG" level is switched on - and robustness - which is why you can't pass fundamental types directly, and use "inserters" (e.g. pantheios::integer). See this recent blog post by Pantheios' author for more information.
I managed to get log4cxx to work, this was done in Visual Studios 2013 running on Windows 7 OS.
This following is what I did, step by step:
Download the log4cxx ZIP package extract its contents, http://logging.apache.org/log4cxx/download.html
Download apr and apr-util ZIP packages, http://apr.apache.org/download.cgi
Then
manually extract this zip apr-1.2.11-win32-src.zip (the
extracted folder should be named 'apr', if it is not manually rename
it)
manually extract this zip apr-util-1.2.10-win32-src.zip (the
extracted folder should be named 'apr-util', if it is not manually
rename it)
open a command prompt and run the following: cd
apache-log4cxx-0.10.0 configure (this
will execute configure.bat)
We will need to disable to use of the APR ICONV and LDAP support.
In order to do so, we will append the following files manually:
Open apr-util\include\apu.hw. Find the line starting with “#define
APU_HAVE_APR_ICONV”. Change the value to 0 and save.
Open apr-util\include\apr_ldap.hw. Find the line starting with
“#define APR_HAS_LDAP” Change the value to 0 and save.
We need to build the log4cxx.dll, to do so convert *.dsw
to *.cxproj.
Launch Visual Studio 2013 and open log4cxx.dsw.
VS will ask if you like to convert everything. Simply click Yes.
There may be some warnings in the migration report, but nothing that
should prevent the solution from opening.
> The projects xml, apr, and apr-util should build successfully.
If you try compiling the log4cxx project it will most
likely fail with hundreds of errors. This is due to a bug in VC++
which can be worked around.
Move all macros outside (above) the class they are in.
LOG4CXX_LIST_DEF macro is used to define classes. All macros reported in error C2252 will need to move out of any classes. This
may also include moving definitions which are used in the macro.
Next, change all LoggingEvent::KeySet to KeySet (this is no longer nested in a parent class)
> Following this, the log4cxx project should now compile
successfully on your machine.