c compiler does not works
Hello everyone,
I am a :newbie: to slackware.. Well, when i try to install ghc(the depency package for zlib)i came into clash Code:
... Code:
This file contains any messages produced by compilers while thanks for the help in advance.. |
It seemed to check for /usr/bin/gcc, and did not error there. But you should check your compiler installation anyway, until you can verify that the compiler is installed and will generate a program file.
In Slackware the compilers are in the developers section and must be installed. They are not installed by default. You could easily install most of the developers section. You could also use a programming editor (something better than Write). Unless you already know EMACS, do not install EMACS. Do not try to compile packages until you have verified that you have installed all compiling tools needed. Required: 1. gcc There are several sections of the gcc compiler, C, Objective-C, Fortran, that can be choosen. Usually choose: C C++ 2. gpp 3. Include files in /usr/include 4. Gnu-Make 5. Any libraries that you might need, along with their include files that allow compiling for them. 6. Tons of other stuff that I don't remember right now. Compile a small test program such as "Hello World". There are several hundred versions around. #include <stdio.h> int main( ) { printf( "Hello World\n" ); } Do this test again in the kind of directory that you are trying to compile. The problem with your package can be as simple as using a directory to compile where you do not have write permission. In that case do your package compile in a user directory, then use root or sudo to copy it to /usr/local/src. Once this works you can move on to package requirements, which usually involve additional libraries that must be installed. |
Did you do a full install of Slackware (that is the recommended way, install it all)? If you did the C compiler will be there.
How are you installing GHC, are you using SlackBuilds? See this site for more http://slackbuilds.org/ There is also a Slackware specific forum here on Linux Questions. Folks are great and help is thorough. Here is link http://www.linuxquestions.org/questions/slackware-14/ |
Quote:
Quote:
|
Can you compile a simple C program? Copy the below code into a file called hello.c:
Code:
#include <stdio.h> Code:
gcc hello.c -o hello |
Quote:
Quote:
Quote:
Quote:
Quote:
additional libraries in the sense you mean??:scratch: |
Quote:
Code:
root@slappisMekaniker:/home/slacker# cd /usr/local/src |
Quote:
|
You have an old installation kit.
Gcc no longer supports a -V option. I believe what it wants is "--version", or maybe "-version". The difference is that "--version" just prints the version information and exits, the "-version" prints the version information then continues to process other options and compiles files. |
Quote:
|
As I recall the gcc -V option was discontinued a couple of years ago - somewhere around version 2 (or 3).
For the script to be assuming the -V option is available implies it is from that time. There was a bit of a rash going around when it was removed, but most of the projects/autoconf scripts were updated at or before its removal. |
Editor: vi is a minimal editor. If X windows use Kate. If console use jed or joe.
The difference is in the syntax highlighting and program editing features. Makes a big difference when you get into looking at C code and other files with heavy syntax. Compile simple program. Do not use make for this first attempt. >> gcc simple.c -o simple.o To test make (which also tests for Make install) >> rm simple simple.o >> make simple.o >> make simple This will not find a Makefile, so it will use default rules ( simple.c -> simple.o -> simple ) to make the "simple" executable. To test run the file >> ./simple Your <stdio.h> should be in /usr/include/, the standard place for gcc to search for include files. I often compile as root, but then I am experienced. You should not compile as root because you could make such wonderfully expensive mistakes with no chance of the system stopping you. If you compile as root in /usr/local/src then you can go straight to installing as root. If you compile as a user (elsewhere usually), then the system will protect you more against your own mistakes, and any mistakes in the package (or outright attempts to attack your system (hostile package)). You could compile in a user owned directory in /usr/local/src, and then chown to root the directory and all files in the directory, for installing. You need to use root or sudo to create the user owned directory in /usr/local/src. Many times you can even test and use the program without installing. You copy to /usr/local/src to install so that system source is kept in a root controlled and protected directory. You need to use root to install (or use sudo) because that step requires root privileges. Install in Linux places the program in /usr/local/bin, and creates any directories in /usr/local/share, copies man files to /usr/local/man, and does this such that all users can access them but cannot change them. Programs that are recompiled from sources provided by the Linux distributor as part of the distribution are usually compiled (re-compiled) in /usr/src. This is usually a custom compilation of the Linux kernel or some modification. Use pkgtool and the like (look in /sbin) to install, re-install, and remove Slackware packages (only). There is a rpm tool to install Red-Hat packages (different file format). Other packages use tar and zip. All the Slackware packages put a log entry into /var/log/packages. That will tell you if it was installed, if you know the right name, but not if it is working. The other posters are right, some compilations are failing due the -V option on the gcc command. Interesting that it did not complain about it every time. It then failed trying the "-qversion" option. These could be tests for compilers on Unix, FreeBSD, or Watcom, and other similar but unique C compilers. Configure then tried a different compile and failed due to missing crt1.o, crti.o, and crtn.o. I have run into this before, but cannot remember what it was. I suspect that these crt are supplied by some installed package (maybe in MinGW). (They may be for DOS or Windows installs, cannot remember right now). These configure files are written for the package, and involve tests for various different C compilers, and even different versions of gcc, so it is normal for them to have a few failures as they check for other unusual compilers first. They should eventually discover the gcc you are using, assuming that the package was meant to be compiled on what you are running, and not something else like a MinGW version of gcc. |
Depends on the version of "vi"... Most systems don't run the original vi - they run vim.
And vim has syntax highlighting (sometimes painful as the colors chosen are not necessarily easy to see). The problem with highlighting is the limited number of distinguishable colors. Get too many and the colors clash, or cause very poor contrasts...(hard to read blue letters on black background or vice versa) |
Quote:
Code:
root@slappisMekaniker:/usr/local/src# gcc simple.c -o simple.o Quote:
So what should i do to fix the above and below problem..?:( Quote:
|
I am curious, and this may not have anything to do with it, but why are you doing all this as root in /usr/local/src (Yes, the slackbuilds are run later as root, I know, I doall them from home folder I call builds, and run as root)? I have always done my c programs as normal user in my home directory in a subfolder I name bin, using a straight normal full install of Slackware and have never had an issue. Is this just a stock Slackware install you are using?
Have you installed Slackware64 or the 32 bit version? And if the 64, are you multi-lib? |
All times are GMT -5. The time now is 03:35 AM. |