cpp problem


Forum: Other Help Topics
Topic: cpp problem
started by: Di4l

Posted by Di4l on Dec. 12 2006,10:38
Hello all,

 I am new to Linux, so please forgive my ignorance. I would like to know what "script" I need to launch to set the enviroment options, paths, etc... to be able to use cpp.

 So far, when I open a terminal, if I type cpp, it does not find the binary as it is not in the environment path.

 Here at work, we use Solaris, and to be able to compile we have to execute a script to set all the necessary variables. My problem is taht I don ot know how to create such a script from scratch and for DSL.

 Any help would be apreciated. Thank you

Di4l

Posted by mikshaw on Dec. 12 2006,14:16
Cpp is not found in DSL, so that would explain your trouble. DSL base system has only tcc for C development.
The gcc compiler, complete with cpp, make and many headers, is available through the MyDSL system.

In Linux, the scripts used to set up your environment include .bash_profile, .bashrc, and .xinitrc, depending of course on whether or not you're using Bash, and what sort of environment changes are necessary. In any case, these scripts are usually automatically run at the appropriate time.

Posted by Di4l on Dec. 13 2006,11:25
Hello,

 Thank you very much for your reply. On the < DSL packages >, the cpp (GNU C compiler) is listed down. In any case I would install the gcc package (already downloaded).

 About the scripts. This is probably a very stupid question but I am very new to Linux... How does the system "know" what type of script needs to run? I mean, if I open a terminal and I want to compile, how does it automatically know that I wnat to use the gcc compiler to run the appropriate script? Don't I have to run it specifically? (Something like ". ./.bashrc" or whatever).

 One last question. On Dillo screen that pop-ups at the DSL start, it explains how to do a hard-disk installation. It recomends using the Frugal install for several reasons, one of which concerns the dsl packages. I am not sure I understand correctly but, does that mean that if I use the other installation (Debian like) I cannot setup the dsl packages I want to run at boot time?

 Sorry for all the hassle

Di4l

Posted by ^thehatsrule^ on Dec. 13 2006,14:42
That page does not reflect what's currently in the recent default iso.

Depending on the script, it will know :P
Sometimes you may have to point CC to gcc, (ie CC=gcc or symlink cc to gcc) but most of the time ./configure (or similar) will uhh configure everything for you :)

Not really needed for this topic, but those are startup scripts - so you don't have to call them again (unless you changed it during a session or using a different app that doesn't look at them)

For Debian-style installation, using dsl packages may work, but it's permanently installed - with the exception of the only safe extensions: uci's (and unc's will not work).

Posted by mikshaw on Dec. 13 2006,14:51
The packages page is hopelessly out of date. The 50mb self-imposed size limit of DSL requires that any addition to DSL's size in one area results in the removal of something else. As the distro has evolved, the software selection has changed. By the way, cpp is preprocessor, gcc is the gnu C compiler. tcc (tiny C compiler) is available in DSL.

The system know which scripts to run only because of the way it is configured, and the way certain applications (such as bash) are built.  As far as choosing the appropriate compiler, this is often done by the makefiles included with source packages. Many of them will set the CC variable to gcc by default, so if you have gcc installed into a standard location (/bin, /usr/bin, /usr/local/bin) it will be found. Otherwise this is a case where manual intervention might be necessary. I don't know what method you use to compile, so i can't say uch about that particular subject. Some other scripts are run automatically simply because that's the way the software has been coded. Bash will run $HOME/.bash_profile when you log in, so if you have any environment variables exported from that script they will apply to subsequent shells. The .bash_profile script can be overridden when you start an x session by changing variables in .xinitrc, which is automatically run when X is started.

If you have a Debian-style harddrive install, any *.dsl or *.tar.gz extesions you add to the system will stay in the system, so the auto-loading of them is not necessary. Extensions named *.uci are mounted, so they will still require auto-loading.  A word of caution, however...
myDSL extensions that write to the base system are not recommended for a Debian-style installation, and in some cases have been knwn to cause troubles.  If you have this type of installation, it is recommended that you consider using  Debian packages (apt-get/dpkg) instead of *.dsl or *.tar.gz (uci should still work without trouble).

Posted by Di4l on Dec. 14 2006,07:05
Thank you so much for everything.

I do have a Debian install in fact. I have finally installed gcc package plus some others. Some don't seem to work, like rar.dsl. I install it but I can't see any new icon, or menu option in myDSL, and doing a "find" for "*rar*" don't get any succesful results.

The reason for wanting to install gcc is taht I needed to compile the drivers for my 3Com Etherlink 3c900B-TPO ethernet card. I have managed to compile but I am having some trouble making it work. However, since I believe the net sub-forum is more apropriate I will place a complete question about this in there.

Thanks again for everything,

Di4l

Posted by ^thehatsrule^ on Dec. 14 2006,15:32
heh, I think I made that extension a while back...

did you read the .info?

If i remember correctly, this is a cli only package, hence no icon or menu option.  Otherwise, maybe it's broken or its cause of your debian hd-install :p

Posted by Di4l on Dec. 15 2006,09:29
ooooops. I'm afraid I did not read that .info file. Bad boy.

At first, when I did not see any menu or desktop icons I thought it would be a "console" app. But I did not know where to start looking for it. I did not know the bin name either. I'll be a good boy and read the .info file. You know, whene everything else fails, read the instructions!!!

Di4l

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