Does Poco work with LLVM standard C++ library? - c++

C++ is not currently one of my main languages - still learning. . . (so go easy on me). .
I'm setting up Poco on iOS. . . It works when I link against Gnu C++ standard library, but when linking against LLVM standard library I get a bunch of errors - unable to find std::string. . .
Does it work with llvm standard lib?
Does it work with C++11 (interesting questin, but not that important since I'm also interested in targeting Android and using Poco for the Threading).

We have built static libraries that work for both iOS, and also for Android: using the Android platform notes presented here
Minor edits to the code should make poco work using stlport_static. but using gnustl_static works out of the box.
the iOS static library work out of the box in Xcode using: c-dialect:GNU99, c++-dialect GNU++11, C++-library libc++ and the LLVM 4.2 compiler.
GCC_C_LANGUAGE_STANDARD = gnu99
CLANG_CXX_LANGUAGE_STANDARD = gnu++0x
CLANG_CXX_LIBRARY = libc++
(One tiny edit might be needed on version 1.51 of poco for iOS and Android, if stl-library version you have is different from the std:: namespace used in Poco).

Depends which version you use, 1.5.1 release should work (see https://github.com/pocoproject/poco/issues/46 ). I don't think the fix was backported to 1.4.x

Since there were no other answers, answering based on the advice from the comments:
As of Jan, 2013, it will work with C++11 dialect, but it doesn't seem to like the llvm std lib. . Gnu std lib works.

Related

How to use Mingw graphic library in DEV-C++?

I am using MinGW64 for compile my codes.
How to use the graphics library in Dev-C++(MinGW64) in Windows?
Or write a simple example?
Dev-C++ hasn't released any new versions in the last 7 years. I think this software was abandoned. I used Dev-C++ a long time ago to, but I switched to Code::Blocks and I remember the transition was very smooth.
I made a short explanation on how to configure MinGW-w64 in Code::Blocks at https://winlibs.com/#usage-codeblocks and I assume it should be quite similar in Dev-C++.
As for graphics.h: this is not part of MinGW-w64, but the following projects provide it:
SDL_bgi: https://sdl-bgi.sourceforge.io/
winbgim: http://winbgim.codecutter.org/
Both these packages can be built with MinGW-w64.

Link errors with AutoSeededRandomPool when using Xcode and libc++

Trying to develop simple c++ stuff in xcode for the first time. I haven't done c++ for a while, nor do I usually use a mac so bear with me if this is trivial.
I have simply grabbed the AutoSeededRandomPool example source from here: http://www.cryptopp.com/wiki/RandomNumberGenerator#AutoSeededRandomPool
I used macports to grab libcryptopp +universal (the non universal one didnt work either though), and I have added libcryptopp.a to the 'link binaries with libraries' build phase for my target.
During the build I get 22 errors, which you can see for yourself here: http://i.imgur.com/wIhEQot.jpg
Using xcode 4.6.2 on oldish Lion OS X macbook pro.
Have I missed something obvious here? Thanks for your help
You're not using the correct compiler — The project you mention states the requirement is:
Xcode 3.2.5,
Xcode 4.0 and GCC 4.2,
targeting Apple iOS
...It appears you're using clang++
http://www.cryptopp.com/#platforms
Also this says iOS, not OS X - That could certainly cause some issues as well. Why bother messing with this crypto library anyway? Use Apple's or one that was meant specifically to be used with OS X. It's of course your choice, but it certainly doesn't make it any easier going this route.
I have found the source of the problem was linking with the libc++ standard library rather than the more standard libstdc++ library. Xcode and Mac OS X targets were not a problem.
If I link against libstdc++ then the linking errors disappear. For future reference the giveaway seems to be the std::__1 namespacing visible in the errors, although with hindsight perhaps it should have been obvious that a library ported from linux would most likely be using the libstdc++ library.

GLib syntax errors, while compiling libnice with latest GLib for win32

Some necessary background:
Libnice (p2p library) was meant to be compiled using 2.28 Glib (here's win32 compilation readme https://github.com/jcaden/libnice/blob/master/README.win32),
BUT the official example
(this one http://cgit.collabora.com/git/user/kakaroto/libnice.git/plain/examples/sdp-example.c),
implementing compiled before libnice, obviously was written using latest glib stuff.
I assume, it is possible to rewrite example for the older one, but latest glib is more elegant and cool all around, that's why I got a wish to use it.
Now, my question:
While trying to compile Libnice using latest GLib (got it from here http://www.gtk.org/download/win32.php) for win32, using Visual Studio 2010, I encounter some syntax errors (Many of them).
You can see log here https://gist.github.com/anonymous/71e2a80e57eb4b8ae6c1
Is it fixable, and how?
P.S: to use latest GLib, I downloaded same stuff, that was described in readme; i.e Glib dev and runtime and zlib and gettext runtime.

boost asio giving You must add -D__USE_W32_SOCKETS to your compiler options on cygwin

I was trying to use the boost library first time. Using as an environment Eclipse 4.3 with CDT and as compiler gcc 3.4 and boost 1.53.
I was browsing various sites to find info on how to setup boost, but it doesn't seem to work. When I compile trying to include boost/asio.hpp I get the error:
You must add -D__USE_W32_SOCKETS to your compiler options
However, I don't want to use windows sockets, I want to use posix, so I don't really know what is wrong. As I need the project to run on HP-UX later, I dont want to get to Windows specific. If I use now windows sockets will the program later be easily portable to Unix, or are all the details encapsulated in boost, and I don't have to care anyway?
I tested a simple testprogram using FOREACH loop to confirm that boost itself works, and this is the case.
I also found this: https://svn.boost.org/trac/boost/ticket/7881 so does it mean that this problem is currently currently not supported, or am I doing something wrong?
It seems what you're trying to do is not supported by the library, the documentation states the following under supported platforms
The following platforms and compilers have been tested:
Win32 and Win64 using Visual C++ 7.1 and Visual C++ 8.0.
Win32 using MinGW.
Win32 using Cygwin. (__USE_W32_SOCKETS must be defined.)
Linux (2.4 or 2.6 kernels) using g++ 3.3 or later.
Solaris using g++ 3.3 or later.
Mac OS X 10.4 using g++ 3.3 or later.
added emphasis is mine. If that's not possible, you might try the patch suggested in the linked ticket. However, grepping through the source code I see several occurrences of #if !defined(BOOST_WINDOWS) && !defined(__CYGWIN__) so it's not obvious that simply patching io_service.hpp will resolve anything. You might try adding -U__CYGWIN__ to your CXXFLAGS, though the cygwin toolchain may not like that.
Full disclosure: I am not a Windows guy so hopefully someone else will chime in.
The libboost-devel package in the Cygwin distribution includes patches to not use Winsock on Cygwin in Boost.Asio. I suggest trying that in conjunction with the gcc4 packages, which provide more recent versions of GCC.

Building C++ cross-platform static libraries

I want to build cross-platform statically linked library in C++.
How am I supposed to do this(I am a complete NOOB, never been using g++,gcc,mingw etc I looked on the internet for a solution to my problem, but didn't find anything. Except that mingw is a Minimalist GNU for Windows...)? I've been always using Visual c++ on windows, but now I have to build lib which will be attached to Qt projects for: windows,mac,linux.
If anyone know a good tutorial, on using compilers, and how to build libraries, I'll appreciate sharing them here :)
Thanks, may the force be with you.
MinGW is a very good compiler! I use it all the time. Even though MinGW stands for Minimalist GNU for Windows, MinGW has everything you need to program in either C++ or C. If you are creating a QT Application, I recommend using QT Creator (just google it). I haven't used it lately, but I think it supports Cross-Platform compiling (as does MinGW, with some command-line commands...).
The best way to cross-compile though, is but getting a copy of each OS that you are going to compile for. So if you are doing Windows, Mac, and Linux, I recommend getting one of each (Mac OS X is around $25 and Linux is free). Then just use the included compilers (XCode on Mac; GCC on Linux) to compile. Unfortunately when you are performing cross compiling, you need to support each OS individually (some parts can shared between OSes).
Since you will be using a toolkit (QT), you probably don't have to worry much about platform specific calls or anything. Just make sure you use the QT typedefs and structs and not the Microsoft Windows ones...