IF i have a C program that is running on SUN OS and If I want to get the same program to compile in RED-HAT LINUX, what are the things I need to look at ?..
Or can some one guide me to any resourse that gives some details on this...
Printable View
IF i have a C program that is running on SUN OS and If I want to get the same program to compile in RED-HAT LINUX, what are the things I need to look at ?..
Or can some one guide me to any resourse that gives some details on this...
Too vague. If it's a purely Standard/ANSI C compliant program, there's nothing you have to worry about or look into. The difference comes down to really the difference between compilers, libraries, and system calls.
Quzah.
With any luck, you will have only used functions which are either
- ANSI-C standard functions
- POSIX functions.
Just look at each external function you've written and read the manual page for it.
It it says "ANSI-C" (like strcpy) or POSIX (like stat), then you should be good to go.
Well, I can be more precise now, As the last assignment for this summer, my project guide has asked me to get a program that runs on DEC--ALPHA to work on LINUX. I have no idea what this does, all i know is it uses pg-plot.. It compiles and runs successfully on DEC_ALPHA, but I get the following errors in LINUX,
I sniffed around and I could locate some of the " .h " files on the net, but to create the " .a " or the " .so " lib files, I need the ".c " or the ". o " files. Any idea how to go about..I am having pgplot installed on my machine.Code:In function `main':
: the `gets' function is dangerous and should not be used.
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `do_lio'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `e_wsle'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `e_wsfe'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_rsfe'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_cmp'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `do_uio'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `e_rsfe'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `f_inqu'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `e_rsue'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `i_indx'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `do_fio'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `e_wsfi'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_cat'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_stop'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_wsfi'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `G77_getenv_0'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_rsue'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `f_clos'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `f_open'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_wsle'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_wsfe'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..//libpgplot.so: undefined
reference to `s_copy'
yeah, found out all of them sit in the file " libg2c.a" ..thanks anyway
looks like u have been using gets fucntion. don't use then read FAQ
ssharish2005
Well, its actually not my program, just helping some one else..That is taken care of.. I am still getting one more error :
Code:
In function `_start':
../sysdeps/i386/elf/start.S:77: undefined reference to `main'
And "_start" is actually defined as a variable.. Any suggestions?
I have used main in the normal way itself ,
Code:
int main( int argc, char *argv[])
.............
..............
return 0;
ha! -combine to the rescue ..