LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 12-17-2004, 12:25 AM   #1
ss100
LQ Newbie
 
Registered: Dec 2004
Location: areepparampu
Posts: 17

Rep: Reputation: 0
Incompatibility of c compiler between unix and Linux


Hello to all,
I had written a C program in an old Unix machine about six months ago which was running fine. Now the disk has been corrupted and I cannot access this program. However I had made a spare copy of this program in a Linux machine. On checking I find that the code is exactly the same (checking with a hard copy) but there is a segmentation error on running (compilation is OK). The program is about 500 lines long.
Kindly give me a few hints as to what I should check for to diagoize the problem.
Sincerely yours,
A. S. Padmanabhan,
Professor of Physical Chemistry
 
Old 12-17-2004, 01:26 AM   #2
carboncopy
Senior Member
 
Registered: Jan 2003
Location: Malaysia
Posts: 1,210
Blog Entries: 4

Rep: Reputation: 45
I am not so much of a programmer. but maybe you can debug it using gdb.

Library depencies would probably be the suspect here. Maybe the library was implemented differently on the Unix and Linux. Then again, all this are my 2cents.
 
Old 12-17-2004, 03:34 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Did you make a copy of the source and compile it using gcc for running on linux?

Try compiling it with the -Wall and -pedantic options and see if you get any warnings.

Here is a detailed article by IBM on debugging techniques in Linux:
http://www-106.ibm.com/developerwork.../?dwzone=linux

I hope it helps.

There is a book titled 'Linux Programming by Example' which may be worth your while picking up. It contains detailed information on topics like memory allocation. Such as making sure you have a valid pointer after using realloc().
There were some mentions of differences between some gnu routines and the unix equivalents.
Another book, Advanced Programming in the Unix(R) Environment starts out with detailing the SUS compliance of Unix and Linux versions, and how to determine certain standard values at compile and run time.

You probably should of posted this message in the 'programming' forum instead. The moderator may actually move it there.

Last edited by jschiwal; 12-17-2004 at 03:47 AM.
 
Old 12-17-2004, 08:33 AM   #4
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,692

Rep: Reputation: 45
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

other thread is here:
http://www.linuxquestions.org/questi...hreadid=267331
 
  


Closed Thread



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
PDF incompatibility Linux Mac OS X lel800 Linux - Software 7 12-20-2004 07:11 PM
Incompatibility of C compiler between Inix and Linux ss100 Programming 8 12-20-2004 03:24 AM
Unix Book for Beginners (Not Linux... Unix) suse2166 General 6 11-25-2004 11:46 AM
UNIX (Linux, BSD, etc) Programming :: UNIX kuphryn Programming 8 04-04-2004 11:50 PM
pavilion linux incompatibility dennis_demski Linux - Software 2 02-11-2002 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:28 PM.

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