C object code compatiblity with UNIX and Linux


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting C object code compatiblity with UNIX and Linux
# 1  
Old 09-26-2016
C object code compatiblity with UNIX and Linux

Is it possible to use an object code compiled on Unix- sun Os sparc on Redhat linux OS. In our new application we have to create object file on Unix os and then use the object code on Linux OS to compile pro*c code but when we are trying to achieve this we get error: file in wrong format. how can we achieve this functionality? Is it possible to use object code from unix on Linux?
# 2  
Old 09-26-2016
A Guess:
ELF format is a standard, but I think you may have a problem with endianess. For example Red Hat LINUX 7 for IBM Power8 servers has 2 builds:

IBM Knowledge Center Error

Quote:
Big endian (BE) operating systems support 32-bit and 64-bit applications. Little endian (LE) operating systems exclusively support 64-bit applications
Starting with Red Hat Enterprise Linux 7.1, Red Hat provides separate builds and licenses for big endian and little endian versions for Power.
Solaris is on SPARC is big endian. Only.

Exactly what systems do you have?
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 09-26-2016
X86 has different endianness and opcodes, compared to Sparc.
Even Linux on Sparc and Solaris Sparc are different because they use different libraries.
And so are Solaris x86 and standard Linux.
# 4  
Old 09-26-2016
Quote:
Originally Posted by vivek chaudhary
Is it possible to use an object code compiled on Unix- sun Os sparc on Redhat linux OS. In our new application we have to create object file on Unix os and then use the object code on Linux OS to compile pro*c code but when we are trying to achieve this we get error: file in wrong format. how can we achieve this functionality? Is it possible to use object code from unix on Linux?
If you use a cross compiler then you can take your source code and produce an object file for both SunOS and RHEL machines...
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Programming

How to initialize an object with another object of different class?

How to initialize an object of class say "A", with an object of type say "B". The following code give the error message "error: conversion from âAâ to non-scalar type âBâ requested" #include <iostream> using namespace std; class B; class A{ public: A() { cout <<"\nA()" << endl; } ... (1 Reply)
Discussion started by: techmonk
1 Replies

2. Shell Programming and Scripting

Creating CLOB object in unix

Hi All, I have a big file (basically .log file) want to store in oracle database. Please help me in preparing CLOB object in unix. The log file is stored in some location on unix file server, prepare clob of that file and store in DB. Any sample code or link Thanks Rajesh (1 Reply)
Discussion started by: rajeshorpu
1 Replies

3. Programming

help with C++ code that relate the object with physical address

I need some help to write a C++ code that read and write the register of a sequencer. I have to make a code that relate the objects with the physical address but I am a bit confuse. Could someone suggest me how to proceed? in which parts do I split the code? thanks (1 Reply)
Discussion started by: silviafisica
1 Replies

4. UNIX for Dummies Questions & Answers

Object reference not set to an instance of an object

I am new to PHP and UNIX. I am using Apache to do my testing on a Windows Vista machine. I am getting this error when I am trying to connect to a web service. I did a search and did not see any posts that pertain to this. Here is my function: <?php function TRECSend($a, $b, $c, $d,... (0 Replies)
Discussion started by: EddiRae
0 Replies

5. Programming

How to modify this c code to get full GUI interface for Unix Linux ?

Hi, the following code comes from Unix Linux dialog utility project. Unfortunately, this project is no more actively maintained. Unix Linux dialog utility is made of widget boxes. One of them is mixedgauge.c In the following example I would like to get rid of flickering when run in... (0 Replies)
Discussion started by: jack2
0 Replies

6. UNIX for Dummies Questions & Answers

to make groupings of object using unix command

suppose u have a file 1 2 2 -3 2 2 -3 4 5 -2 -3 -4 -4 -2 1 1 1 so output should be lie that one for groupings... (1 Reply)
Discussion started by: cdfd123
1 Replies

7. Programming

Problem In Loading A Shared Object In Linux

Hi, We are trying to migrate our Solaris Soft OSE application to Linux. We use the dynamically linked options of the soft ose in our application. We are facing plenty of unresolved symbol problems while trying to load the ".so". These symbols are present in the libsoftose.a. for e.g ... (1 Reply)
Discussion started by: phani@tcs
1 Replies

8. UNIX for Advanced & Expert Users

“Ostream” object is not printing message on HP-UNIX for debug mode

The following C++ code segment is not working in debug mode build on HP-UNIX machine. It is not printing "Hello World" message on the screen. While it is working fine in release mode build. ============================================== class KLogStreamBuf : public streambuf { public:... (0 Replies)
Discussion started by: heena
0 Replies
Login or Register to Ask a Question