how to call memcached api in Windows C++ - c++

I am trying to use memcached for my windows C++ application, aiming to cache large table contents for performance optimization
This is first time for me to implement caching with open source library, and most memcahed source I have found online are either for Linux only or for 32-bit windows (very out of date), also need docker.
Please let me know if there is any good Windows Memcached source easy to use
One possible resource I have found is: https://github.com/jefyt/memcached-windows
But README just telling you how to install & run memcached from cmd line, there is no hint for how to build and use as an C++ client library in windows, plus, I could not find any example code also
Can anyone point me a direction for how to add memcached as client library to be called in my C++ code on Windows (something like #include <memcached/...> )
Thanks a lot
K

Related

Where do I store cross platform C++ app storage?

I want to store gigabytes of media locally - and have them automatically removed when the app is uninstalled. I found this question, but it requires the qt library, and only stores app settings.
I'm guessing there's a convention followed across Windows, Mac and Linux. Are there any std helpers - or the like - for storing app data, cross-platform.
If not, is there a convention for the paths would I need to store these in, on each platform? I plan on creating an installer for each operating system, so it would be useful to know these paths so I can install my other data here.
I want to store gigabytes of media locally - and have them automatically removed when the app is uninstalled.
The average but skilled user is capable of copying the media elsewhere and would backup his disk regularly.
However, most C++ programs have a main accepting program arguments, and you could conventionally provide program arguments to remove the data. Be sure to properly document your design.
See this answer. On Unix or POSIX systems (Linux, MacOSX, FreeBSD....), you might accept a --clean-all-the-mess program option.
I'm guessing there's a convention followed across Windows, Mac and Linux.
As far as I know, this guess is wrong. (things are much more complex)
More generally, read about package managers. There are many of them. See guix for an interesting example. Debian and Fedora have different ones. Look into GNU stow and autoconf.
You could want to use a database, perhaps SQLite or PostGreSQL.
On Linux, see also Advanced Linux Programming then syscalls(2) and more about systemd.
On Windows, read about the WinAPI.
Is there a convention for the paths would I need to store these
Linux has hier(7) but some Linux distributions (including Android) don't follow that.
My recommendation: study the C++ code of some open source software close to your goals. You could find some of them on github or gitlab or SoftwareHeritage. See also POCO.
"Application Uninstall" event is visible to the OS, so your best bet is on finding some OS-specific hooks to register your call-backs to remove your local files yourself.
EDIT:
C++ STL is a piece of code (library) to write applications that run on top of some OS, so STL is not the place to look for application install/uninstall events, that are OS-level events. But nothing prevents you from writing an Uninstaller application for any OS. The question is who or how and when it will be executed.

where can I find grpc library for c++ windows and Linux both

I am trying to setup grpc server for a embedded device which runs the C++ environment. I have followed the link at https://github.com/grpc/grpc/blob/master/INSTALL.md, but I am unable to understand what needs to be done there in a order for grpc library to be available or installed in C++ libs.
Setting up grpc for C++, I assume to be having a generic approach for windows/Linux environment apart from the specifics of C++ run time location
The approach at above location says to build, but its failing for me at step,
With error as below,
Anyone if having more detailed link/reference to step by step process would be really helpful
For building gRPC under Windows nowadays, I would highly encourage people to use the provided CMakefile.
We haven't done any work towards supporting cygwin however, and we don't have any plans in supporting it at the moment. Most of the Windows-specific codebase would expect msys/mingw or VC, and I wouldn't be surprised if it would fail at runtime with cygwin even if you manage to compile, as our usage of the Linux API is probably too advanced for cygwin's emulation layer.
The Makefile should potentially behave properly under msys, if you insist on using it.

connecting to web service from freebsd or other OS

i will explain my problem and please try to help me
i want to access a web-service from Point-Of-Cell Handheld
its SDK use C language on eclipse
at first i wanted to learn how to access web-services from C or c++ LANGUAGE
and i succeeded in this using gsoap library and i can access a web-service using it.
i modified the stdsoap2.c file to can fit the handheld library as i modified tcp-connect and tcp-send and tcp-receive and so on
my problem here there is alot of errors in this file, it is run time error as memory fail or pthread fail and so on
my director told me that it is because this file is for windows and ask me to search for gsoap version work on another platform
he tried the Linux version but it didn't work too
he asked me to search for a copy that work on embedded system or on FreeBSD OS
is he right? and is there any copy of gsoap can satisfy my need?
Gsoap is available on FreeBSD. Just install the port from /usr/ports/devel/gsoap
If your code was written for windows, you will have to replace windows-specific functions with those available on FreeBSD.

How to do code-review/debug/coding/test/version-control for C++ on perforce and VMS

I am working on C++ programming with perforce (a version control tool) on VMS.
I need to handle tens or even hundreds of C++ files (managed by perforce) on VMS.
I am familiar with Linux, python but not DCL (a script language) on VMS.
I need to find a way to make programming/debug/code-review as easy as possible.
I prefer using python and kscope (a kde based file search/code-review GUI tool that can generate call graph) or similar tools on VMS.
I do not have sys-adm authorization, so I prefer some code-review GUI tools that can be installed without the authorization.
Would you please give me some suggestions about how to do code-review/debug/programing/compile/test by python on VMS meanwhile using kscope or similar large-scale files management tools for code-review ?
Any help will really be appreciated.
Thanks
Your question is pretty broad so it's tough to give a specific answer.
It sounds like you have big goals in mind which is good, but since you are on VMS, you won't have a whole lot of tools at your disposal. It's unlikely that kscope works on VMS. Correct me if I'm wrong. I believe a semi-recent version of python is functional there.
I would recommend starting off with the basics. Get a basic build system working that let's you build in release and debug. Consider starting with either MMS (an HP provided make like tool) or GNU make. You should also spend some time making sure that your VMS based Perforce client is working too. There are some quirks that may or may not have been fixed by the nice folks at Perforce.
If you have more specific issues in setting up GNU make (on VMS) or dealing with the Perforce client on VMS, do ask, but I'd recommend creating separate questions for those.
Indeed, it's not clear from your question what sort of programming you want to do on VMS: C++ or python??
Assuming your first goal is to get familiar with the code-base, i.e. you want the ease of cross-ref'ing the sources:
If you have Perforce server running on VMS, then you may try to connect to it directly with Linux Perforce client. And do "review" locally on Linux.
If you've no Linux client, I'd try fetching the latest revisions off and importing raw files it into an external repository (svn, git, fossil etc.). Then again using Linux client and tools.
If your ultimate goal is to do all development off VMS, then it may not really be viable -- the code may use VMS specific includes, system/RMS calls, data structs. And sync'ing the changes back and forth to VMS will get messy.
From my experience, once you're familiar with the code-base, it's a lot more effective to make the code-changes directly on VMS using whatever editor is available (EDIT/TPU, EDT, LSE, emacs or vim ports etc.).
As for debugging - VMS native debugger supports X-GUI as well as command-line. Check your build system for debug build, or use /NOOPT /DEBUG compile and /DEBUG link qualifiers.
BTW, have a look into DECset, if installed on your VMS system.

Tools for Unix <-> Windows C++ development

I am doing some C++ cross development - been doing that for a while on Windows and recently started on Unix.
I suppose what I am after is to simplify Unix development experience - I have a local windows box I do development on, and a remote Solaris box which I use to compile and test code on unix environment.
What I do now - I develop, compiled and test code on Windows (VC++) and once it is done, I move code to Solaris box using Filezilla over SSH. I also use Putty to connect to Solaris box and execute shell commands.
Since I am quite new to unix development - I suppose what I do is by far not optimal and the tools/technics I use not optimal too.
Can you recommend me a better tools - how to move code around more easily and may be a replacement for Putty (which looks quite outdated anyway).
Thanks.
If by any chance you want to run the same C++ IDE on both Windows and Solaris, I recommend taking a look at Code::Blocks. Also, as I suggested to Charles, running an X server on the Windows box gives you a lot more flexibility than running Putty or similar.
Is there any reason that You can't test software on Solaris using Virtual Machine? They can share folders so there is no need to uploading code to remote machine.
Second: use svn or git or mercurial. In one machine You check in your code, on other you checkout plus You have history of changes. No need to use Filezilla over SSH.
edit:
Also, I think that it would be good to use cmake (or scons - but I don't used it) to generating build files. For example - cmake generates Makefiles or project files for Your IDE, so You don't need to maintaint few different files that build Your code on different platforms.
You might want to look into Samba, so you can work directly with the Windows file explorer to move files to and from Windows/Unix environments, rather than using FTP.
But for UNIX shell access via Windows, you really can't beat Putty.
I recommend mercurial.
Just use a version control system such as Subversion or Mercurial. I strongly recommend the latter because it's distributed so you don't need to have a server per say and you can work offline. Every time you want to shove your Windows code to the unix machine you just need to do 'hg push' and off you go. To sort out the build you can with good old Make or just use SCons (again I prefer the latter because it comes with the power of Python).
I actually, very recently developed a cross platform project in C++ using wxWidgets and GraphicsMagick. I wrote it all in Mac OS X and then compiled both in Windows and Linux. One thing I'd like to point out is that GCC seems to be more pedantic about compile warnings and errors than Microsoft's compiler so if you grow to like the Unix environment I'd recommend to develop there and then compile in Windows (maybe even using a VMWare image).
Instead of moving your source code around manually, consider using a version control system. Not necessarily a distributed VCS such as git or mercurial, but you should use version control nonetheless.
Sooner or later, you'll need to use a debugger on the Unix machine, and if you prefer using a graphic debugger, you should install a local X server on your Windows machine.
IMHO vim is quite good editor ;)
gcc, nm, ld for compilation/build/diagnosis
makefile for builds
gdb as debugger, if you prefer GUI check ddd (if you want to stick
with Visual Studio for debugging
check www.vsbridge.com or
www.wingdb.com - they both
depends on gdb as back-end)
other commercial debugger for Unixes
is TotalView
(http://www.roguewave.com/products/totalview.aspx the price is
high, although they have their own
engine instead of gdb)
CVS, SVN as source control
If you want to edit files in VisualStudio you can use e.g. Samba as "transparent file system" ;)
By the way VirtualBox may be very helpful (I debug (Open)Solaris or Linux as VBox machines very frequently).
ps
yet another environment you may be interested in is Magic C++ www.magicunix.com/