LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 08-26-2003, 01:10 PM   #1
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Rep: Reputation: 30
Question C Source Code?


Hi, I tried to compile a lot of codes in C and always have errors when I compile! above the code that doesnt works me

Thanks

Last edited by Gerardoj; 08-26-2003 at 04:22 PM.
 
Old 08-26-2003, 01:14 PM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,261

Rep: Reputation: 45
if you want any old source code then theres more than you could ever read at sourceforge.
 
Old 08-26-2003, 01:16 PM   #3
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Original Poster
Rep: Reputation: 30
Thanks, and what do you think that is the problem that I never can compile codes in my linux box?
 
Old 08-26-2003, 01:24 PM   #4
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 58
you'll have to show us what your doing and what errors you get to answer such a question.
 
Old 08-26-2003, 01:55 PM   #5
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,261

Rep: Reputation: 45
well after having a quick look at that site it seems to be very windows orientated, and even if i select standard C/C++ a lot of the code is still dependant on non-standard libraries for example graphics.h from borland. if there is a particular piece of code from there you wish to compile please feel free to post a link to it and im sure someone here will try to help you.
 
Old 08-26-2003, 04:26 PM   #6
Gerardoj
Member
 
Registered: May 2003
Location: Somewhere over the Rainbow
Distribution: Slackware 9.x, Knoppix, Damn Small Linux, RedHat.
Posts: 465

Original Poster
Rep: Reputation: 30
I run this code in Linux with gcc filename.c and doesnt works, what coul be the problem?

#include <stdio.h>
#include <conio.h> //for getch();
#include <graphics.h>//for graphics
void main ()
{
int dirver, mode ;
int x1=0 , y1=0; //for line
int x2=199 , y2=199; // for line
int xC=100 , yC=100; // for circle
int radius=90; //radius of the circle
dirver = DETECT; // detecting the driver of VGA automatic
initgraph (&dirver , &mode , "c:\tc\bgi"); // initilizing graph
line (x1,y1,x2,y2);
circle (xC, yC, radius) ;
getch();
closegraph(); //closing graph
}
 
Old 08-26-2003, 04:39 PM   #7
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 58
the graphics.h library was provided by borland and microsoft in the early 90s....do you have this? that library is only packed with borland 4 and earlier..
i dont know, but this may help
so the long and short of it is, is that graphics.h is not standard C, so maybe you could check out ggi (libGII)
 
Old 08-26-2003, 04:41 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,821

Rep: Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116
Gerardoj, please try to start providing some useful information. you have a program there, which clearly has some sort of error when it doesn't work, yet you never actually provide any useful information... if you want solutions you've got to help yourself first....
 
Old 08-26-2003, 04:42 PM   #9
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,261

Rep: Reputation: 45
as i said in your post in the programming forum 'draw circle'

graphics.h is specific to turbo c++ for dos from about 10 years ago it will NOT work anywhere else that is the problem with the code.
 
Old 08-26-2003, 04:48 PM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,821

Rep: Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116Reputation: 1116
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

thanks for pointing that out kev82, get's tiring repeating yourself huh?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Assembly code to "C" source code ssg14j Programming 2 08-01-2005 12:48 PM
where is source code? heraklez Mandriva 5 07-31-2005 05:47 PM
Source code hey_joe Linux - Newbie 1 03-14-2004 01:06 PM
Source Code help palbox2003 Linux - Newbie 1 02-23-2004 04:10 AM
Source Code dvong3 Linux - Newbie 3 07-13-2003 12:20 PM


All times are GMT -5. The time now is 07:06 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration