Sponsored Content
Operating Systems Linux Red Hat Run program compiled in Ubuntu in centos Post 302981452 by drl on Tuesday 13th of September 2016 10:33:33 AM
Old 09-13-2016
Hi.

One solution is to take your libraries with you, at least in a limited sense,

One does this by using the link option:
Code:
       -static
           Do not link against shared libraries.  This is only meaningful on
           platforms for which shared libraries are supported.  The different
           variants of this option are for compatibility with various systems.

-- excerpt from man ld, q.v.

before you transfer the executable to another platform (a similar platform, I hasten to add). I have done this several times without problems.

A draw back is that the resulting executable will be, of course, far larger in size compared to its dynamic version.

Best wishes ... cheers, drl
 

9 More Discussions You Might Find Interesting

1. Programming

Running a compiled Program

Just getting into the Unix command line programming and am unable to run any program I write. I am using a Makefile and the source is compiling but when I enter the name of the output file I get back: bash: lab01exe.out: command not found I'm sure I am just dooing something simple... (2 Replies)
Discussion started by: Krebsbac
2 Replies

2. Programming

How to use a .exe with a compiled program.

I am confused about how to use a .exe file in unix along with a compiled C++ program. I've been using emacs and I compiled with g++, but I have no idea how that relates to use with a .exe. (1 Reply)
Discussion started by: adamsy
1 Replies

3. UNIX for Advanced & Expert Users

cannot run c compiled programs

iam in the way of making graphics using SDL.i copied from cd usign mount -a /cdrom cd /cdrom cp SDL-1.2.11.tar.gz /usr/test cd /usr/test gunzip SDL-1.2.11.tar.gz tar -xf SDL-1.2.11.tar cd SDL-1.2.11 ./configure ... ... it stops at checking whether the c compiler... (4 Replies)
Discussion started by: kumarangopi
4 Replies

4. Shell Programming and Scripting

Problem with `cat` the compiled output of C program in unix

Hello All, I have coded a C program which looks something like below... (program name: test.c) #include<stdio.h> main() { int dist,dm,dcm; printf(" Enter the distance between 2 cities in KM : "); scanf("%d",&dist); dm=dist*1000; dcm=dist*10; printf("Distance between 2 cities in... (6 Replies)
Discussion started by: smarty86
6 Replies

5. UNIX for Dummies Questions & Answers

Making a program compiled on Unix (HPUX) work on Linux

I am trying to make an application which works on unix to work on linux. I already tried copying the binary files and start it up but I am getting an error stating "Cannot execute binary file". Then I tried to recompile but i am getting an error whenever I tried to recompile. I am getting the... (1 Reply)
Discussion started by: khestoi
1 Replies

6. Homework & Coursework Questions

Calling compiled C program with Perl program

Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies

7. Solaris

Issue in pro*C program compiled in solaris 10

Hi, We upgraded our servers from solaris 9 to 10. We recompiled all the Pro*C programs with the new oracle version as well. Oracle is 11g. We are facing core dump with the below error for certain executions. But when we are placing new statements between the error fucntion we get junk values to... (1 Reply)
Discussion started by: saroopkris85
1 Replies

8. Programming

Using ANSI color codes in gcc compiled program

I have put some yellow color codes and works well. I call the funstion using print_usage(stderr, 0); I would like to know if there is any way, to store the ansi color codes in variables and then call them inside fprintf. Or have a format followed by the strings I want to output. ... (5 Replies)
Discussion started by: kristinu
5 Replies

9. Web Development

Building LAMP server from scratch (build a server with compiled LAMP from CentOS mini)

Hello everyone, I would like to setup a lamp server from a minimal distro and to compile PHP, MySQL and Apache myself. I have chosen CentOS minimal for the OS and I am trying to build the stack by hand... But well, it appears I need some help! First: I am looking for good and recent... (3 Replies)
Discussion started by: freddie50
3 Replies
SHTOOL-SLO.TMP(1)					      GNU Portable Shell Tool						 SHTOOL-SLO.TMP(1)

NAME
shtool-slo - GNU shtool separate linker options by library class SYNOPSIS
shtool slo [-p|--prefix str] -- -Ldir -llib [-Ldir -llib ...] DESCRIPTION
This command separates the linker options ``-L'' and ``-l'' by library class. It's argument line can actually be an arbitrary command line where those options are contained. slo parses these two options only and ignores the remaining contents. The result is a trivial shell script on "stdout" which defines six variables containing the ``-L'' and ``-l'' options sorted by class: ``"SLO_DIRS_OBJ"'' and ``"SLO_LIBS_OBJ"'' contains the ``-L'' and ``-l'' options of static libraries, ``"SLO_DIRS_PIC"'' and ``"SLO_LIBS_PIC"'' contains the ``-L'' and ``-l'' options of static libraries containing PIC ("Position Independent Code") and ``"SLO_DIRS_DSO"'' and ``"SLO_LIBS_DSO"'' contains the ``-L'' and ``-l'' options of shared libraries. The -p option can be used to change the default variable prefix from ""SLO_"" to str. The intent of this separation is to provide a way between static and shared libraries which is important if one wants to link custom DSOs against libraries, because not all platforms all one to link these DSOs against shared libraries. So one first has to separate out the shared libraries and link the DSO only against the static libraries. One can use this command also to just sort the options. OPTIONS
The following command line options are available. -p, --prefix str FIXME -Ldir Directory where libraries are searched in. -llib Library to search for. EXAMPLE
# configure.in LINK_STD="$LDFLAGS $LIBS" eval `shtool slo $LINK_STD` LINK_DSO="$SLO_DIRS_OBJ $SLO_LIBS_OBJ $SLO_DIRS_PIC $SLO_LIBS_PIC" : HISTORY
The GNU shtool slo command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1998 for Apache. It was later taken over into GNU shtool. SEE ALSO
shtool(1), ld(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-SLO.TMP(1)
All times are GMT -4. The time now is 03:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy