[NTLUG:Discuss] C Program Woes on Ubuntu

George Lass george.lass at sbcglobal.net
Thu May 31 10:26:40 PDT 2018


I have just installed Ubuntu 18.04 LTS on a 4 or 5 year old Dell PowerEdge R210 II.  I have updated and upgraded to the latest versions of everything.  I am having problems trying to execute even the simplest C Language program:
#include <stdio.h>
int main(int argc, char *argv[]){        printf("this is a test");        return 0;}

No problem building the executable from the source file x.c:
# make xcc       x.c      -o x
But I am unable to actually run the executable:
# ./x-bash: ./x: Permission denied

It isn't a problem with file permission:
# ls -l x-rwxr-xr-x 1 root root 8288 May 31 12:19 x

And I don't *think* it's a compatibility issue with shared objects since it seems to use the same library as bash:
# file xx: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=4167fc090a21cefc7aa84aae77c4203bb35ac56b, not stripped

# file /bin/bash/bin/bash: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=b636f50d85c3cca7cf2518030446660c1d90d660, stripped
Does anyone have any ideas as to what is going on?
Thanks,
George Lass



More information about the Discuss mailing list