OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World C program using printf. Compiles and runs fine on Kali Linux at home. When I upload the executable to the CentOS server via Filezilla and chmod and execute the file, I get a seg fault.
HostGator server CPU is AMD-Opteron-6378 running CentOS. I'm compiling using gcc on a Lenovo laptop using Kali Linux Live Boot and the gcc that comes with it. The compiling computer's processor is Intel Core i5-2450M, Little Endian, 64-bit, x86-64.
I compiled it using the regular old gcc helloworld.c -o helloworld
. No warnings, no errors, runs fine. Same program seg faults on CentOS.
I ran the "file" command on the helloworld executable on the HostGator CentOS server and got this...
ERROR: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs) error reading (Invalid argument).
I'm a little confused on the "dynamically linked (uses shared libs)" part. What "linking" would there be? It's a Hello World program using printf.
I'm hoping this is just a problem with me not supplying the right compiler flags?