LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-16-2010, 09:04 AM   #1
fishwater00
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Rep: Reputation: 0
How to transfer C codes from UNIX to Linux


Hi Folks,

I got some problems and need your help.

In school, my codes are writeen under UNIX system (Solaris10/SUN), now I need to transfer those codes to Linux (Redhat5). But after I directly copy to Linux, it shows many errors and warnings.

Does anyone know which codes I need to modify to specifily suit for UNIX? I am not familiar with those systems and hope to get your kind help.

Thank you very much.
 
Old 06-16-2010, 09:14 AM   #2
fishwater00
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Original Poster
Rep: Reputation: 0
I found many errors on "exit" and "malloc" build-in function, what's going on here?
 
Old 06-16-2010, 09:19 AM   #3
rikijpn
Member
 
Registered: Jun 2007
Location: Japan
Distribution: Debian lenny, DSL, Solaris 10
Posts: 157

Rep: Reputation: 33
"my codes" = the source code of some program/s written by yourself, right?

Mainly the difference is in the processor/architecture (maybe you are using a sparc chip in solaris, and an Intel x86 architecture one in the linux one).

I assume that you mean you're trying to recompile the source codes, but you get a lot of errors when you do. Check for the libraries needed for the sources to compile. Install any non-installed (needed) ones, and try again.


Quote:
I found many errors on "exit" and "malloc" build-in function, what's going on here?
Probably using a different compiler? I assume you mean C code. You probably weren't using gcc on Solaris ("man cc" on that machine).
Even when you get those messages, do the sources compile properly? (you get a binary file?)
 
Old 06-16-2010, 09:19 AM   #4
fishwater00
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Original Poster
Rep: Reputation: 0
I got it. Add <stdlib.h>
 
Old 06-16-2010, 09:25 AM   #5
fishwater00
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Another question: under UNIX, I use this to complie:

gcc -g -o codes codes.c -lget -lstd -lm

But when I use it under Linux, it shows:

/usr/bin/ld: cannot find -lget
collect2: ld return 1 exit status

What's that mean? Thanks.
 
Old 06-16-2010, 09:43 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Does your program use "libget"?

"-l<library name>" links in a library.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
migrate / transfer / copy unix users from true 64 to CentOS 5.0 ytd Linux - General 2 01-17-2009 09:27 AM
command to transfer files between 2 unix machines Linuxfan0001 Linux - Networking 31 04-11-2008 05:17 AM
Are the hex codes for colors in a jpg the same codes as used in html? abefroman Linux - Security 3 07-31-2005 03:21 PM
unoptimised unix C codes that reduces system performance frankfrancis Linux - Newbie 0 01-20-2005 03:44 AM
need to transfer unix sendmail server to upgraded box garrett *BSD 1 01-23-2004 04:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration