C++ executable not working on linux based hosting server - c++

I created an static executable for a CGI application in CentOS 64-bit. The program is using cgicc lib. Then I executed the executable on the same machine (where I created executable file) as well as on another CentOS 64-bit machine (where cgicc lib don't exists). On both machines it got executed successfully. But I have a web hosting server there same executable is not working. The web hosting server is linux (64-bit) machine, but not sure of exactly the linux flavor. In log I found internal server error. Even I checked the executable is having 755 permission. Can some one help in finding the reason? Thanks in advance.

My first thought is maybe your hosting server has different kind of CPUs. Different CPUs have different instruction sets, so different c++ compiler may be used for binaries. Like if you want to run some program on embedded system with ARMs, you need a cross compiler for it.

Related

Visual Studio 2017 remote code synchronization

I've been developing a c++ project on linux remote server these days, however, I'd like to do all the coding things on my windows machine using VS2017. So I need some kind of synchronization tool to synchronize the codes such that whenever I save the file in VS2017 the changes can be synchronized to the linux server immediately. Is there any tool or VS2017 extension can help me?
I don't want to use git as it may cause a lot meaningless commits.
Several ideas:
Cygwin. Compile your code on the emulated Linux/Unix environment for local testing and use Visual Studio as your IDE. Do final testing on the Linux box with less frequency. Can be combined with any of the ideas below.
Git, but with a different branch for commits. Do a squashed merged for all meaningful commits or pull requests to master.
Samba. Mount your Linux file system on your Windows PC or vice versa. Copy files between Windows and Linux as if was a network drive.
Local VM. Run Linux in a local Virtual Machine with VMWare or VirtualBox. Drag and drop files between Windows host and Linux guest OS using the host/guest extensions stuff. Then you can dink around with deploying to the real Linux machine later.
Personally, for my open source projects where I'm too lazy to boot into Linux locally to test code before deploying to AWS, I basically do some combination with the above.
And #5 of course is: Dropbox. :( I use OneDrive and a Python script on Linux to pull down files.

Deploying a C++ application developed on Mac OS in a Ubuntu environment

I have developed a small web server based on Crow, link.
I'm pretty new to developing in C++ so all advices are greatly appreciated.
I'm developing the application on my Mac and intend to deploy it to a Ubuntu server.
I use Make to build the application so that I can run it on the Mac. The application is depending on two libraries, pqxx and png++. None of those are installed on the server.
I'd like to know how to run this application on the Ubuntu server. Mainly I guess the issue is, can I make a specific build on the Mac that is targeted for running on the Ubuntu server? Or do I have to build the application on the server?
Easiest way is to install Ubuntu on a VM on your Mac and deploy there your application.
Less easy solution: move source files on server, deploy the application, delete the sources from server.
Theoretically, both system are linux, so as long as you are using standard c++ libraries the code should run anyway.
In any case, the dependencies on Linux and Mac for Crown are different, so (most probabily) you have to install some libraries on your server.

How Remote Development of C++ works in Netbeans?

Hi we want to use remote development features of netbeans but while trying out on our setup its very slow. I want to understand its feasibility of integrating our build environment with netbeans.
Our setup would be normally:
1. Windows 7 Professional 64bit where we install netbeans
2. RHEL 5.5 64bit linux where we have tools and sources
Normally we directly connect to that machine through PuTTY and use VIM to edit sources and gmake to compile and build projects. Now when I created the "New Remote Project with existing sources" and try to use it It took more time to load the project.
So Can anybody tell me how actually this remote compilation works??
Because we have some GBs of sources here on linux box and I want to know is it possible for smooth development with this big data??
Simple steps. Read this tutorial. You just need a SSH-server on your Linux.
The process is easy, your Netbeans connects to the SSH-server and searches for compilation tools then uses them to build your projects.
The second issue is creating a shared folder that your Windows and Linux able to access to it. I suggest you first create a shared folder on your Windows and use Samba client on your Linux.

Problems running remote C++ program in Netbeans

Here is the scenario.
I have a C++ application using CMake that has been setup on Ubuntu server machine. I have setup a remote development interface to it using Netbeans 6.9 on client machine, and I have been able to build it.
The problem is that (as per the setup of CMake script) the executables from the program are going to another directory in the server. When I try to run the program, Netbeans asks me for executables which I can't spot out on client machine (as they are residing on server machine).
Is there a way I can get the executables on local machine OR have a way to give their location to my Netbeans application.
Thanks for your help.

Can I build and debug c++ programs on remote machine?

I am on windows XP want to build the programs on linux remote pc
i have eclipse Ganymede, CDT, RSE installed on remote machine... but how to configure all this?
am I doing correct? could anybody suggest
You could access your remote machine using VNC or similar remote desktop infrastructures. That would allow you to work with Eclipse (edit, build, run, debug, etc) as you would in your local machine.
If bandwidth is too narrow or you don't manage the Linux box, you could access via SSH or telnet and work in console mode (with Emacs/Vim, gdb and all that stuff).
Take a look at https://github.com/ericwoodruff/rmake you would configure your IDE and edit code locally but it uses rsync to build on the remote machine. I've used it at HP to build C++ programs across multiple platforms, linux->windows, windows->linux. It works in the command line and I've used an eclipse builder to invoke it as well. If you enable --no-decorate Eclipse can even parse the build output into the problems view.