LDAP c++ API choice [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I would like to write my own LDAP client under Linux, specific to our local environment. Most probably I will use QT4 to provide a shiny frontend without much hassle.
I found that there seems to be no standard C++ library for this. OpenLDAP provides a C API and there should also be a C++ API (experimental?) somewhere..
Do I need to use the C stuff or is there a C++ API out there worth of recommendation?

I've actually written a C++ wrapper for OpenLDAP's C API for my day job and it wasn't my most enjoyable experience.
I didn't find a suitable C++ wrapper out there for my purposes (this was in 2006 so things may have changed since). I wound up directly interacting with the C api, which wasn't terrible but it does have some oddities. Assuming you go to the C/OpenLDAP route I can offer you a couple of tips.
Something that I found a little weird, the C API is defined in RFC1823 which means that pretty much every library has the same API.
In the case of OpenLDAP however a number of the RFC1823 API calls have been deprecated, particularly around the authentication parts. Depending on who distributed your OpenLDAP library and what version it is will determine if these deprecated functions have been disabled.
The main changes to avoid the deprecated API are switching from ldap_init() and ldap_open() to ldap_initialize() and using ldap_sasl_bind() (which confusingly handles all types of auth)

I found following c++ wrapper useful. Open Source C++ wrapper

This question is not easy to answer without knowing specifics of libraries you need.
I would say if C++ library based on Qt and available in source code - that'd be the front runner for sure. And if C++ library depends on some other not-Qt framework - don't even try to mix it with Qt.
C-based libraries generally have less dependencies, though a bit awkward and require more attention to details (initialization / deinitialization) comparing to C++ (destructing class usually means releasing all tied to it resources).

Related

C/C++ HTTP Client Library for Embedded Projects [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
The community reviewed whether to reopen this question 9 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
So I have trawled through pages and pages of search results on StackOverflow and Google and I have come across very few C/C++ HTTP client libraries suitable for a resource-constrained, embedded environment (e.g. an ARM). I have however come across quite a few that are suitable for desktop-class applications.
Essentially, I am after a simple, easy-to-use and convenient API to make HTTP GET, POST and HEAD calls (with support for authentication, download resume and payload compression). It would be ideal if it had a small footprint (i.e. no or minimal external dependencies) and is open-source (with a permissive license).
Here's a list of what I've come across so far and why they are not suitable -
curl - too heavyweight
poco - too heavyweight
neon - GPL
qlibc - relies on POSIX libraries
cpp-netlib - relies on Boost libraries
serf - relies on the Apache Portable Runtime library
urdl - relies on Boost libraries
HTTP Client C API - promising but requires a C++ wrapper
Are there any libraries out there that I am unaware of or am I better off rolling my own?
Have you taken a look at the HTTPClient on mbed? Looks like there are lots of forks of an original from a few years ago that wasn't maintained. I haven't used this...
http://mbed.org/users/WiredHome/code/HTTPClient/
I can just describe what I used for those tasks.
curl - if you are lazy, you can just download in built binary and have nothing to do more, it has very simple headers and a lot of examples. You will need 3-4 already built libraries and header. With no external dependencies. So, I would count it as too low-level, but not heavyweight at all.
boost.asio - very interesting paradigm of realization, quite easy and clean. But I would say it is low-level too. Harder then curl. And needs to use boost, that is external dependency you want to avoid, I guess.
poco - best solution for http server. It's high level, after you joined it to your application, you just need to implement few virtual functions, having all other work (and thread management) done. Poco gives a lot of stuff for application management, thread/process management and it is very simple and easy, I would even say it has java-like interface. Yes, there is external dependency to poco, but I would look at this as a chance to learn perfect library. Still, for http clients it is really heavy.
That is all my C++ experience with HTTP. Counting you need just client and don't need dependencies, I would offer you to look at libcurl library. It's cross-platform, easy, no dependencies and low-level enough to get all you need with network. And if you will have time - look at Poco, really, I believe you will fell in love with this library as I did.
Hope that will be helpful.
I found another one, which just needs to be packed into a lib.
didn't test it, but may be worth a look:
https://github.com/reagent/http.git

C++ Core Application Development framework , Open Source , Cross Platform [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Like Qt , do we have any core application development framework in c++.
I think the qt is mainly for GUI applications . I need something other than QT , which gives a much faster running code ...
Visual Studio for c++ is a good choice , but its not an open source and cross platform one ..
To put it bluntly, to me it sounds like you're wasting your time and do not have clearly defined goal for your application. No framework can fix this problem. Write down application specification, list of target platform, check what functionality is required but missing, search for existing libraries, then use them.
I think the qt is mainly for GUI applications
You're mistaken.
In Qt 4 GUI component is optional. You are free to design console applications using QCoreApplication instead of QApplication for application object. As a bonus you get access to some GUI-related classes (not all of them, though - many require QApplication).
which gives a much faster running code
Making code run fast is your responsibility. If it runs slowly, then it is your fault until proven otherwise. Qt 4 is very fast, at least as far as GUI performance is concerned. Poor selection of algorithms, abuse of memory allocation routines and many other things can negatively impact performance. Switching to different framework won't fix those. Instead of searching for different tool, profile your code, search for bottlenecks and fix them.
Visual Studio for c++ is a good choice
It is not cross-platform. It is also not a framework - only IDE+compiler.
Cross Platform
Depending on your application you could even develop cross-platform application in standard C++ without any frameworks while using CMake/Scons/Autotools for build process. Unix-like environments have POSIX standard they more or less attempt to conform to, which can be used (on windows it requires cygwin/msys to be functional). Aside from that there's Boost. You could even ditch C++ and switch to scripted language to ensure portability. It all depends n your goals. Since you haven't said what you're writing it isn't possible to recommend anything specific aside from Boost. In addition to boost there are several frameworks (wxWidgets, Fox Toolkit, GTK) that may or may not meet your requirements.
Since it is not exacly clear what you mean by framework you might want to clarify that a bit more. Anyways, I am a happy user of boost as libraries for generic functionality and use eclipse + cdt as IDE to do coding and debugging. Boost, eclipse and the cdt are open source and cross-platform.
Which features should have the framework? How about the BOOST? It's not a framework as QT and wxWidgets, but it has a lot of features like delegates aka signals, threads, inter-process communications, network, etc.

What is the most popular general purpose C++ framework? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I was looking at Qt and came to wondering, what is the most popular general purpose C++ framework, and what are some pros and cons of it?
The STL and Boost are both pretty popular, and they're pretty much the epitome of "general purpose".
Qt is very popular. It's available under open-source (LGPL) and commercial licenses, has fully-featured core and GUI class libraries and an integrated IDE and build system. It's also cross-platform.
It's under very active development and has a new declarative UI library (QtQuick including QML) due in the next release (4.7).
Definitely worth checking out for new projects.
For Windows-only work MFC is still worth a look. It's recently been updated.
The question as it stands is probably unanswerable; you'll probably end up with a list of people's interpretation of "framework" with no real way for distinguishing them.
Perhaps we need a definition of framework? I suggest it is a library that in some way determines the architecture of an entire application. However that is perhaps a definition of "Application Framework", but if you mean the term more broadly, then the question is probably too broad. This definition however makes say Qt a framework, while Boost remains just a library. That makes Boost no more or less useful, so I really don't understand what you are trying to discover from the question.
Here's a list of UI related libraries that might be considered "frameworks":
MFC
.Net
WxWidgets
Qt
KDE
GNOME
TurboVision ;-)
The most notable distinguishing feature is that some of them are cross-platform, and some are platform specific. Gnome is perhaps distinguished by having a C API (GTK+). .Net supports multiple languages, but requires C++/CLI rather than ISO C++ (but that is no worse than Qt's pre-processor IMO). MFC is a bit long in the tooth and not supported by free or third-party tools. TurboVision is antique and included for my amusement and geek nostalgia.
I know this post is old but I found it very useful.
I would like to add PoCo (POrtable COmponents) to the list
I used it for seleral projects and includes a consistent and well designed framework for:
XML
Multi threading
Networking
Cryptography
General purposes
It is also portable (I used it on Windows and Unix).

What open-source COM implementations work on embedded systems? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Improve this question
I am considering using COM interfaces within an embedded (non-Windows) system that has a limited C++ compiler, and I am looking for an open-source COM implementation using simple C++, in particular with little or no use of templates and without use of exceptions (yes I know COM doesn't use exceptions but an implementation could use them internally).
At this point I'm mainly looking for C++ definitions of all the core COM types i.e. IUnknown, IDispatch, VARIANT etc. plus some helper classes for smart pointers, BSTRs etc. Some level of support for implementing QueryInterface and IDispatch might be nice but I can also do that myself. I'd like to find an ITypeInfo implementation, and an embedded implementation of DCOM would be attractive.
I know I could use Microsoft's source supplied with Visual Studio but I would rather avoid it because of the complexity of pulling in a lot of definitions that I don't need, plus I want to avoid any possible legal issues with using it on a non-Windows platform. I'm also thoroughly familiar with ATL and I can't use such a heavily templated approach due to compiler limitations. I have a lot of experience with COM and DCOM so I could write all of the definitions and helper classes myself, and I could even write my own DCOM system if needed. But I'd rather use an existing open-source implementation if there is one. Do you have any recommendations?
A few years ago I was considering starting a FOSS implementation of COM/DCOM, but didn't get anywhere, mainly because I didn't think that would be interesting to anyone in the open source community. There is the proprietary implementation by Software AG (called EntireX DCOM), which I assume would not be interesting to you.
As for open source projects, other than Samba and Wine implementations and XPCOM in Mozilla, there is OpenCOM. They have posted their code on SourceForge.
The closest Open Source implementation I am aware of is Mozilla's XPCOM (it's not exactly the same as Microsoft's COM, but is quite similar). But I am not sure if it's still possible to build it standalone as the instructions provided are quite outdated now.
I would suggest looking at Wine. Source code is in C, not C++, thus avoiding any and all issues with full C++ support, C++ templates, etc. Wine also has implementations for many (most?) of the standard interfaces.
For example, source code to LoadTypeLib (which returns an ITypeInfo implementation) is in dlls/oleaut32/typelib.c:383. ITypeInfo::AddressOfMember is at typelib.c:6742 (in ITypeInfo_fnAddressOfMember).
(It is somewhat odd to see COM implemented in C, but COM defines a binary standard precisely for this reason, so that COM components can be implemented in any language without placing restrictions on the consuming language...)

What is your favorite cross-platform solution to access multiple different databases (MySQL, Oracle...) in C/C++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am writing a simple C++ application which might be installed on Linux or Windows, and which will connect to a database. I want my application to be compatible at least with Oracle and MySQL (or PostgreSQL).
Which C or C++ library would you recommend to handle the database queries: I am open to any library, whether it's very thin (just execute SQL queries) or very fat (a whole object persistence layer, clustering, etc.).
One library per answer, please. A little description (pros & cons) would be great. Thanks a lot.
I enjoy using SOCI, it's very C++ like. When it comes to performance with respect to Oracle database, it's comparable with native OCI. It provides backend to some RDBMS:
Oracle
PostgreSQL
MySQL
And some more in the CVS repository.
It's fairly simple to use, the documentation is thorough and rationale is pretty clear. It supports connection pooling, has nice extensible way of converting between datatypes.
I really liked QtSql
It has the advantage of being well designed and cross platform.
Disadvantage is that it's LGPLv3 (or commercial) licensed and that might not work for everybody.
You don't have to use a Qt GUI, but if you need a GUI library too it's wonderful.
This is exactly what ODBC was designed for. Yes, it was designed by Microsoft, but there are implementations on just about every platform and for just about every database product now.
I use SQLAPI++ and it's a great product. You can try it for free, it's simple to get started and their support is fantastic.
http://www.sqlapi.com/
Seriously? Data Providers.
Nothing beats customizing your data calls for each database. Generic solutions tend to have too many compromises IMO.
Actually, you would be wise to stay away from data provider API as time goes , you will suffer versioning and default parametrisation issues. Best would be to use SOCI when you really need full optimized backend otherwise stick to any facilitator like OTL4.0 for ODBC call.