MQTT Paho C/C++ Client for Windows using Eclipse + MinGW - c++

I am trying to use MQTT Poho C/C++ Client on Windows using Eclipse CDT and MinGW.
On Windows 10 I have installed Eclipse Neon and MinGW latest version with POSIX Thread Support.
Issue with MQTT Paho C++:
I have download the MQTT Paho Client C++ Source and also dependent C Library + headers
I have created a Eclipse CDT MinGW project and trying to build the sample application using C++ Paho
I am not able to build the code as I am getting compilation error for "std::mutex" 'mutex' is not a member of 'std', I tried to resolve it by googling but with no luck
As per one of the solutions I have also uninstalled MinGW which I have previously installed with pthread Win32 support and installed it again with pthread POSIX support.
I am also not able to find Paho C++ Pre-built libraries
Issue with MQTT Paho C Pre-built libraries:
I have download the Paho Pre-built C Library + headers for Windows
The zip file has .lib .dll .h and some samples
Again I have created a test project in Eclipse and included headers and libraries
Also configured the library path
It compiles correctly but linker hits the error and not able to find functions defined in .dll/.lib files
I checked rechecked everything but not sure about the issue
Do I need to use the DLL files provided with the library? I have not used them. I have tried to copy them in the Path and also in the same location as .lib but of no use
Also did google on how to use .dll with Eclipse CDT MinGW but no luck. :(
Let me know if anyone has tried to use Eclipse Paho C/C++ Source/Library With Windows Eclipse CDT MinGW.
Any possible solution to these issues will help.

Related

How do I setup a CMake project with both Allegro and MSVC?

Lately I've been experimenting with the Allegro game library, but I'm having some trouble setting it up in the following scenario:
I would like to create a cross-platform project (for at least Linux and Windows binaries, preferably also OS X) using CMake that utilizes the Allegro game library, but is able to build using MSVC instead of MinGW for the Windows Binaries.
I tried linking statically to the MinGW standard libraries, but the supplied Allegro binaries for MinGW are still dynamically linked, so I'd rather just use the proper Windows compiler.
Does anyone know if it is possible to extract the binaries from the Nuget package or if there's a more proper way to use MSVC and Allegro while still maintaining a cross-platform source code?
I'd prefer not having to build Allegro from source, but if I have to, any links to guides would be helpful.

Static QT build with SSL support using Windows + MinGW?

I'm trying to compile my Qt based application using static linking. So after few days of struggling I have found this article about compiling Qt libraries as static environment.
Everything was OK until I reached problem with SSL support. So I have figured out that in this script (referenced from mentioned article) is configuration which uses -no-openssl parameter. But the build is failing when I try to use different option (-openssl or -openssl-linked).
I suppose I have to compile OpenSSL itself. Is it possible to do that just using MinGW bundled with Qt Creator ?
If not, how can I then link my static Qt environment with compiled OpenSSL in order to successfully build my Qt project through Qt Creator ?

How do I set up OpenCV for MinGW project?

I regularly use Code::Blocks and MinGW for my C/C++ projects. I would like to be able to use OpenCV, since it has a nice library for computer vision projects. They have dropped support for MinGW. I have heard you can build it on your own somehow, but I have no experience doing this with 3rd party libraries. Can someone explain how to build it in a simple way for MinGW?
There is, or at least there was at least until 2.4.6, precompiled version of opencv that works out of the box with mingw as long as you use the dw2(standard) version of mingw.
since i needed sjlj support i had to build my own version of openCV 2.4.6
I did he following - i am pretty sure it will work for the current openCV version as well
Setup your preferred Mingw Environment - i would strongly recommend to use gcc 4.5 or newer
Intstall Msys
Intall Cmake - you can get a binary package
Start the Cmake GUI
Select the openCV source folder
Click Configure and select MSYS-Makfiles
Errors in the first run of Configure might be resolved if you run Configure again
Click Generate
use MSYS make to run the generated makefile
Copy all desired libraries and include files to your mingw-installation or your project

Compiling the Mega.co.nz C++ sdk in OSX 10.8 with XCode

I installed macports and 5 required libraries and can't get this SDK to compile in a C++ command line application inside XCode.
The 5 libraries are
libcryptopp
openssl
readline
freeimage
curl
XCode is generating errors about undefined symbols for architecture x86_64. I started with about 100 but trimmed it down to 22 by correctly importing the libraries and setting the correct header search paths (/opt/local/include). I really want to start playing with this SDK and I'm about at my wits end. There is no support on the site, no repo or version control, just a zip with some source files. Documentation doesn't spell out how the SDK works either.
If you can help I would be forever grateful. The SDK can be found by following this link
https://mega.co.nz/#dev
If it's still relevant you can check my Mega formulae pull request for Homebrew project.

Where does xcode keep its default paths to librarys and headers?

I have a C++ app/project under Linux Eclipse. I started porting to Mac OS X. I use 4 cross-platform C/C++ libraries such as OpenCV, OpenAL Boost etc.
First I installed C++ and Eclipse for Mac. When I opened the project in eclipse it did not find any of my Linux includes. When I opened the code in xcode it solved some - for example OpenAL.
Where does Xcode look for libraries and headers?
Off the top of my head I'd say try the following locations:
/System/Library/Frameworks
/System/Library/CoreServices
/Developer/SDKs
Probably in the first option.
For Xcode 6.4 and the OSX 10.10 SDK, look here:
/Applications/Xcode/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks
Then expand the OpenAL.framework and double click on the Headers folder.