Compiler


Forum: Programming and Scripting
Topic: Compiler
started by: Cypher

Posted by Cypher on Mar. 31 2006,06:37
Does DSL come with a C++ compiler?
Posted by 300c_pilot on Mar. 31 2006,06:58
gcc1.dsl can be installed via mydsl app on the desktop.
Hope it helps
:)

Posted by Cypher on Mar. 31 2006,07:48
Hehe, that should help, but, I'm new to DSL and have no idea how to use..... pretty much anything, including MyDSL.  Obviously, I can use the text editor, but, after that, I'm pretty much at a loss.  

If you can give me specifics, that'd be great.

Thank you.

Oh!  Well, I found gcc1.dsl.  I've downloaded it, now, I need to know how to use it?

Posted by humpty on Mar. 31 2006,14:26
put it in the root directory of your boot partition.
you probably need gnu-utils too.

there are other ways, but get used to the system first. remember that first page dillo displays after you boot ?
read it 5 times, from start to end.

Posted by Cypher on Mar. 31 2006,18:17
Huh, interesting... I will certainly do that.

I'm thinking I'm also buying the book.

Thanks for the help!

Posted by andrewb on Mar. 31 2006,22:55
There is also tcc.dsl in the testing area of the download repositry if you don't need full blown gcc.
Posted by Cypher on April 01 2006,05:46
The problem is, I don't know how to open that.
Posted by clacker on April 01 2006,12:46
open them emelfm program, either from the desktop icon or from the right click tools menu.  Navigate in either of the two panels to where you stored your gcc1.dsl file.  Highlight the file by clicking once on it then press the MyDSL button (on the top in the middle of the window).  That should load gcc for you.  Then open an xterminal and type gcc -v to make sure it's loaded.
Posted by Cypher on April 01 2006,18:28
Oh, that's easy.  Thank you!
Posted by Cypher on April 03 2006,07:29
Okay, well, that should have been easy.  I guess the question becomes how do I then use it?  I've tried to open my .cpp with the path, I've tried to open gcc with the .cpp's path.  Is there supposed to be a sdk for this application?  I've only used Visual C++ up til now.
Posted by clacker on April 03 2006,14:53
Cypher, try this example program called hello.cpp

Code Sample
#include <iostream>

using namespace std;

int main()
{
  cout << "Hello World" << endl;
  return 0;
}


Enter this into a text editor (if you don't know open beaver from the icon and use that) and save it as hello.cpp in your home directory (/home/dsl).

To compile it, open an xterminal (which should put you in the /home/dsl directory) and enter the command line:

g++ -o hello hello.cpp

This should produce and executable called hello, so type hello in the shell and hit return and it should print the hello message.  gcc is the C compiler, g++ is the c++ compiler.  You might want to run the g++ program from the same directory that your *.cpp files are in until you get used to paths and such.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.