Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: compiling source code

  1. #1
    Member registered user
    Join Date
    Jun 2006
    Posts
    46

    compiling source code

    ok im kinda a noob and when i download a programs source code and want to compile it so i have the program i dont really know how to do it....wouldnt i have to find out what language its programmed in and then get that language and then copy the code into that and then compile the program? and if so how woul i go about getting those languages?

  2. #2
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    100
    Hmm... your question has a rather large scope, but I'll try
    to present a few pointers.

    I assume that you're runnig Knoppix from CD (not installed
    on your harddisk) and I further assume that your version of
    Knoppix already provides a lot of the tools you need.

    Very many (most?) programs are written in a language
    called "C". The source you download from somewhere is usually
    archived in a so-called "tar-ball" and comes as a file with the
    name "bestprogramever.tar.bz2" or "...tbz2" or "...tar.gz" or
    "...tgz".

    - bestprogramever: the name of the program
    - tar: it's an archive, needs to be unpacked
    - bz2, gz: it's compressed and needs to be uncompressed

    Depending on the compression method used you simply go to
    where you saved the file (this is command line stuff, so you open
    a console and "cd /to/the/file") and enter
    <code>
    tar xjf bestprogramever.tar.bz2
    </code>
    or
    <code>
    tar xzf bestprogramever.tar.gz
    </code>

    That leaves you with a directory named bestprogramever and you
    cd there.

    Most C-programs consist of many smallish files that end in ".c" and
    ".h". To compile these in the correct sequence requires rather
    intimate knowledge of the program, so there is a central file called
    "Makefile" where all this knowledge is stored. You could edit this
    file in order to tweak the program (say, you'd want output on the
    screen be green instead of white), but today there usually is a
    further file that governs the Makefile: "configure".

    Look for an executeable file of that name; if it's there type
    <code>
    ./configure --help
    </code>

    You might encounter a line (among many) that says
    --with-colour=COLOUR

    So again you invoke configure, this time as
    <code>
    ./configure --with-colour=green
    </code>

    If that succeeds, type
    <code>
    make
    </code>

    You should now have an executeable file called "bestprogramever".
    Start it with
    <code>
    ./bestprogramever
    </code>
    and enjoy!

    Pay attention to the "./"part in some of the above commands:
    it means "right here, not somewhere else on the system" and is needed.

    To install the program to its proper place you'd have to run
    <code>
    make install
    </code>
    but you need to be root for that and also it will not get you far as
    long as you are running from CD.

    There are many, *MANY* more aspects to this subject, so this
    is just a very minimalist starter. Try a few things and feel free
    to come back with more specific questions!

  3. #3
    Member registered user
    Join Date
    Mar 2005
    Posts
    77

    programs

    Whoa - crazy monkey
    check out which program it is here
    (A lot huh) then report back.

    BTW, you need to love the Terminal alot (Shell - Konsole) to compile.
    Tip: C, C++, java, lisp, perl, javascript and maybe fortran should be noted.

  4. #4
    Member registered user
    Join Date
    Jun 2006
    Posts
    46

    thanks

    ok thank you ill fiddle around with that . oh and sorry for lack of detalis but im running knoppix 5.0.1 installed on a hard drive

  5. #5
    Member registered user
    Join Date
    Jun 2006
    Posts
    46

    hmmmm

    ok so i cd'd to my flash drive location (cuz i have the file on my flash drive) and then i entered in <code> tar xjf pingus-0.6.0-binary-linux-i386(2).tar.bz2 </code> and hit enter and it said "bash: syntax eror near unexpected token '(' so i got rid of the '(2)' part of the filename and then all it said was bash: syntax error near unexpected token 'newline'. and i know this is probably a noobies question but whats wiht the <code> </code> tags? looks a lot like html to me...

  6. #6
    Member registered user
    Join Date
    Mar 2004
    Location
    Hampton Roads, VA USA
    Posts
    81
    Uh, not to sound harsh but the <code></code> tags were supposed to indicate "don't type this on the command line, just type what's contained within".

    Most of the time people just use " information that's relevant " as the format but you get variations. Don't feel bad, it happens when you're new at things.

    'Goon

  7. #7
    Member registered user
    Join Date
    Jun 2006
    Posts
    46

    *slaps forehead*

    lol thanks...wow that was a really stupid question...haha

  8. #8
    Member registered user
    Join Date
    Jun 2006
    Posts
    46

    awesome

    lol thats awesome thanks. the game runs really slow but it runs and thats awesome thanks :P

  9. #9
    Member registered user
    Join Date
    Jun 2006
    Posts
    46

    permission denied

    ive recently noticed that many times when i try to run a makefile or something it will say "permission denied" whats wrong wtih that? im not positive but im pretty sure the same thing happened when i tried to run the file as root

  10. #10
    Member registered user
    Join Date
    Jun 2006
    Posts
    46

    Can't Cofigure X

    ok now many times when i try to compile say a game i donwloaded or what have you i run ./configure and it works fine until the last line where it says
    checking for X...configure: error: Can't find X includes. Please check your installation and add the corret paths!

    what can i do to fix this?

Page 1 of 2 12 LastLast

Similar Threads

  1. Problem with compiling source code
    By Redbeard in forum Hdd Install / Debian / Apt
    Replies: 1
    Last Post: 12-01-2007, 05:35 PM
  2. Compiling simple C code
    By maxIT in forum Hdd Install / Debian / Apt
    Replies: 5
    Last Post: 12-30-2005, 10:49 AM
  3. Source Code?
    By ShadowAce in forum General Support
    Replies: 1
    Last Post: 01-04-2005, 07:35 PM
  4. Problem with compiling a c++ code
    By estranged in forum General Support
    Replies: 3
    Last Post: 08-21-2003, 07:13 PM
  5. need source code
    By vynx in forum General Support
    Replies: 2
    Last Post: 05-01-2003, 08:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Dell Poweredge R720 8SFF 2.5

Dell Poweredge R720 8SFF 2.5" x Xeon E5-2680 v2 2.8GHz 20-Cores 128gb 4x Trays

$349.99



Dell PowerEdge R730XD Server 2x E5-2695 V4 = 36 Cores H730p 32GB RAM 4x trays picture

Dell PowerEdge R730XD Server 2x E5-2695 V4 = 36 Cores H730p 32GB RAM 4x trays

$649.99



Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram  2x 550W PSU No HDD picture

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD

$275.00



Dell Poweredge R720 8SFF 2.5

Dell Poweredge R720 8SFF 2.5" 2x Xeon E5-2680 v2 2.8GHz 20-Cores 64gb 4x Trays

$259.99



Dell PowerEdge R620 2x Xeon E5-2630 v2 3.1GHz 2.5

Dell PowerEdge R620 2x Xeon E5-2630 v2 3.1GHz 2.5" 4-BAY 32GB RAM No OS 2x 495w

$174.95



Dell Poweredge R630 2x Xeon E5-2680 v4 2.4ghz 28-Core | 32GB | HBA330 | 2x 1100w picture

Dell Poweredge R630 2x Xeon E5-2680 v4 2.4ghz 28-Core | 32GB | HBA330 | 2x 1100w

$359.99



Dell Poweredge R730xd 12LFF 2*2670v3 4*1Gbe h730 2x 750W Server CTO picture

Dell Poweredge R730xd 12LFF 2*2670v3 4*1Gbe h730 2x 750W Server CTO

$368.00



Dell Poweredge T420 SFF 2x E5-2430 v2 2.5Ghz / 64gb / H710 / 8x Trays / 2x 495w picture

Dell Poweredge T420 SFF 2x E5-2430 v2 2.5Ghz / 64gb / H710 / 8x Trays / 2x 495w

$394.99



Dell R640 Diskless Servers 2x Gold 18-Cores 6254 3.10GHz CPU, 32gb RAM, No Raid picture

Dell R640 Diskless Servers 2x Gold 18-Cores 6254 3.10GHz CPU, 32gb RAM, No Raid

$699.00



Dell PowerEdge R530 2x E5-2630v4 H330 iDRAC8 Port Card Riser No PSU/RAM/HDD picture

Dell PowerEdge R530 2x E5-2630v4 H330 iDRAC8 Port Card Riser No PSU/RAM/HDD

$99.99