Use curl libraries without install them - c++

I'm trying to use the curl libraries in c++ to download some files with Ubuntu, it has to run in a sever but I can't install the packages because I don't have the privileges on that machine. How can I use those libraries without installing them?
Thanks.

You can take curl library from your development machine, put it near your binary and use LD_LIBRARY_PATH environment variable to point out system to where get curl library
LD_LIBRARY_PATH=path/where/your/curl/library ./your-executable
You can build curl library by hands in form of static library and link with your application.

Related

Build a shared library that uses OpenSSL installed on respective Linux machine

Is it possible to build a shared library or Linux application that uses OpenSSL installed on respective Linux machines?
For example, when we compile and link, we use "-lssl -lcrypto" similar to this is there any option or solution to use the OpenSSL library installed on the machine on which the application will be running. We can't use "dlopen".
So my application should be built in such a way that when installed on CentOS 7 it should use the default OpenSSL 1.0.2 of CentOS 7 and when installed on Ubuntu 20.04 it should use OpenSSL 1.1.1
How can I achieve it, please?
You have five options in my view.
Static link OpenSSL
Deploy your application with Anaconda packages
Deploy your application with Docker container
Build separate packages for each OS
Force your users to install OpenSSL from source

supervisor-win How to use for windows server

I downloaded it using pip install supervisor-win, but I didn't know how to configure my Django project file.ini and give Supervisor to manage it. I know how to operate on Linux, not how to write configuration files and use them on Windows.
this is supervisor-win https://pypi.org/project/supervisor-win/

How to deploy C++ project with all dependencies?

I am working on a C++ project that requires third-party libraries (boost, poco, etc). I use cmake/make to install the package to an install location and deploy it to the production machine. However, when pushing the app to another machine, the shared libraries are not present on the target machine causing ld errors. Is there a standard way to detect dependencies (i.e. shared libs) and deploy them to the install location along the application?
You can try Linux Deploy Qt.I use it for deploying my Qt application written in C++. Apart from Qt, it also puts other non-Qt dependencies(libraries) into a single directory. just run it with the executable as the argument.

Custom build environment/target libraries

I want to build an application that will be compatible with, say, Debian Lenny (libc, postgres, oracle and other libs) on a different Debian/Ubuntu release.
Is this possible? If so, where can I read how to do it?
You can use the open build service for this. Create the Debian package description files for it (you can add also rpm spec files), select the target distributions and you will get it built on each platform and also get a specific download repository for each platform. Your package will be rebuilt automatically when needed as well. You can install your own instance of the service if you need to host proprietary code.
If you want a multiplatform binary, you may want to build it against a LSB chroot:
http://ftp.linux-foundation.org/pub/lsb/impl
And bundle any library that is not part of it. The LSB has tools to then check your app for compliance. Their website is down right now, but it should be here: http://ldn.linuxfoundation.org/lsb/check-your-app

Access to Oracle Database with sqlapi C++

I need to write some data in several database.
I choose sqlapi.com
I have made it for mysql and mssql.
Now I have Problem with Oracle database.
I have installed server and client on Ubuntu.
In browser it works, but sqlapi says:
libnnz10.so: cannot open shared object
file: No such file or directory
DBMS API Library 'libclntsh.so'
loading fails
This library is a part of DBMS client
installation, not SQLAPI++
Make sure DBMS client is installed and
this required library is available for
dynamic loading
Linux/Unix:
1) The directories in the user's
LD_LIBRARY_PATH environment variable
2) The list of libraries cached in
/etc/ld.so.cache
3) /usr/lib, followed by /lib
There are both of these files depp inside /usr/lib.
I have tried a lot of ways to say eclipse path to this folder, but nothing works.
Thanks for help.
I think that you need to set the variable LD_LIBRARY_PATH to the file path of the shared lib.
e.g.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oracle/instantclient/lib
set the variable in .profile or .bash_profile. This depends on the shell you are using.
Update
Due to some new security requirements in ubuntu (see https://bugs.launchpad.net/ubuntu/+bug/366728 for details) you cannot use LD_LIBRARY_PATH for non-interactive shells. Use the following procedure (adjust the oracle path to your needs):
echo "/opt/oracle/product/whatever/lib" | sudo tee /etc/ld.so.conf.d/oracle.conf
sudo ldconfig -v