LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2013, 03:27 PM   #1
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Rep: Reputation: 6
Exclamation c compiler does not works


Hello everyone,

I am a to slackware..
Well, when i try to install ghc(the depency package for zlib)i came into clash

Code:
...
ghc-7.6.2/libraries/gen_contents_index
ghc-7.6.2/libraries/prologue.txt
checking for path to top of build tree... /tmp/SBo/ghc-7.6.2
Build platform inferred as: i386-unknown-linux
Host platform inferred as: i386-unknown-linux
Target platform inferred as: i386-unknown-linux
GHC build  : i386-unknown-linux
GHC host   : i386-unknown-linux
GHC target : i386-unknown-linux
checking for perl... /usr/bin/perl
checking if your perl works in shell scripts... yes
checking for a BSD-compatible install... /bin/ginstall -c
checking whether ln -s works... yes
checking for gsed... sed
checking for gcc... /usr/bin/gcc
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... no
configure: error: in `/tmp/SBo/ghc-7.6.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
and config.log states
Code:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by The Glorious Glasgow Haskell Compilation System configure 7.6.2, which was
generated by GNU Autoconf 2.67.  Invocation command line was

  $ ./configure --prefix=/usr --mandir=/usr/man --docdir=/usr/doc/ghc-7.6.2 --libdir=/usr/lib

## --------- ##
## Platform. ##
## --------- ##

hostname = slappisMekaniker
uname -m = i686
uname -r = 3.2.29-smp
uname -s = Linux
uname -v = #2 SMP Mon Sep 17 13:16:43 CDT 2012

/usr/bin/uname -p = Intel(R) Core(TM) i3 CPU         530  @ 2.93GHz
/bin/uname -X     = unknown

/bin/arch              = i686
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /sbin
PATH: /usr/sbin
PATH: /bin
PATH: /usr/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2119: checking for path to top of build tree
configure:2140: result: /tmp/SBo/ghc-7.6.2
configure:2613: checking for perl
configure:2631: found /usr/bin/perl
configure:2643: result: /usr/bin/perl
configure:2656: checking if your perl works in shell scripts
configure:2674: result: yes
configure:2722: checking for a BSD-compatible install
configure:2790: result: /bin/ginstall -c
configure:2804: checking whether ln -s works
configure:2808: result: yes
configure:2820: checking for gsed
configure:2851: result: sed
configure:3028: checking for gcc
configure:3046: found /usr/bin/gcc
configure:3058: result: /usr/bin/gcc
configure:3172: checking for gcc
configure:3199: result: /usr/bin/gcc
configure:3428: checking for C compiler version
configure:3437: /usr/bin/gcc --version >&5
gcc (GCC) 4.7.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3448: $? = 0
configure:3437: /usr/bin/gcc -v >&5
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.7.1/specs
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i486-slackware-linux/4.7.1/lto-wrapper
Target: i486-slackware-linux
Configured with: ../gcc-4.7.1/configure --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,go,java,lto,objc --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --with-python-dir=/lib/python2.7/site-packages --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --enable-lto --with-gnu-ld --verbose --enable-java-home --with-java-home=/usr/lib/jvm/jre --with-jvm-root-dir=/usr/lib/jvm --with-jvm-jar-dir=/usr/lib/jvm/jvm-exports --with-arch-directory=i386 --with-antlr-jar=/root/slackware-current/source/d/gcc/antlr-runtime-3.4.jar --enable-java-awt=gtk --disable-gtktest --with-arch=i486 --target=i486-slackware-linux --build=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 4.7.1 (GCC) 
configure:3448: $? = 0
configure:3437: /usr/bin/gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3448: $? = 1
configure:3437: /usr/bin/gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3448: $? = 1
configure:3468: checking whether the C compiler works
configure:3490: /usr/bin/gcc -O2 -march=i486 -mtune=i686   conftest.c  >&5
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: cannot find crt1.o: No such file or directory
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: cannot find crti.o: No such file or directory
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: cannot find -lc
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
configure:3494: $? = 1
configure:3532: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "The Glorious Glasgow Haskell Compilation System"
| #define PACKAGE_TARNAME "ghc"
| #define PACKAGE_VERSION "7.6.2"
| #define PACKAGE_STRING "The Glorious Glasgow Haskell Compilation System 7.6.2"
| #define PACKAGE_BUGREPORT "glasgow-haskell-bugs@haskell.org"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3537: error: in `/tmp/SBo/ghc-7.6.2':
configure:3539: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-O2 -march=i486 -mtune=i686'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_PerlCmd=/usr/bin/perl
ac_cv_path_SedCmd=sed
ac_cv_path_WhatGccIsCalled=/usr/bin/gcc
ac_cv_path_install='/bin/ginstall -c'
ac_cv_prog_ac_ct_CC=/usr/bin/gcc
fptools_cv_shebang_perl=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ArArgs=''
ArCmd=''
ArIsGNUAr=''
BootingFromHc='NO'
BuildArch_CPP='i386'
BuildOS_CPP='linux'
BuildPlatform='i386-unknown-linux'
BuildPlatform_CPP='i386_unknown_linux'
BuildVendor_CPP='unknown'
BuildingCrossCompiler='NO'
CC='/usr/bin/gcc'
CFLAGS='-O2 -march=i486 -mtune=i686'
CONF_CC_OPTS_STAGE0=''
CONF_CC_OPTS_STAGE1=''
CONF_CC_OPTS_STAGE2=''
CONF_CPP_OPTS_STAGE0=''
CONF_CPP_OPTS_STAGE1=''
CONF_CPP_OPTS_STAGE2=''
CONF_GCC_LINKER_OPTS_STAGE0=''
CONF_GCC_LINKER_OPTS_STAGE1=''
CONF_GCC_LINKER_OPTS_STAGE2=''
CONF_LD_LINKER_OPTS_STAGE0=''
CONF_LD_LINKER_OPTS_STAGE1=''
CONF_LD_LINKER_OPTS_STAGE2=''
CPP=''
CPPFLAGS=''
CrossCompilePrefix=''
CrossCompiling='NO'
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GMP_INCLUDE_DIRS=''
GMP_LIB_DIRS=''
GREP=''
GccExtraViaCOpts=''
GccLT34=''
GccLT46=''
GccVersion=''
HaskellHaveGnuNonexecStack=''
HaskellHaveIdentDirective=''
HaskellHaveSubsectionsViaSymbols=''
HaskellTargetArch=''
HaskellTargetOs=''
HostArch_CPP='i386'
HostOS_CPP='linux'
HostPlatform='i386-unknown-linux'
HostPlatform_CPP='i386_unknown_linux'
HostVendor_CPP='unknown'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
OBJEXT=''
PACKAGE_BUGREPORT='glasgow-haskell-bugs@haskell.org'
PACKAGE_NAME='The Glorious Glasgow Haskell Compilation System'
PACKAGE_STRING='The Glorious Glasgow Haskell Compilation System 7.6.2'
PACKAGE_TARNAME='ghc'
PACKAGE_URL=''
PACKAGE_VERSION='7.6.2'
PATH_SEPARATOR=':'
PerlCmd='/usr/bin/perl'
PortingCompiler='NO'
RANLIB=''
SHELL='/bin/sh'
SedCmd='sed'
SettingsArCommand=''
SettingsCCompilerCommand=''
SettingsCCompilerFlags=''
SettingsDllWrapCommand=''
SettingsLlcCommand=''
SettingsOptCommand=''
SettingsPerlCommand=''
SettingsTouchCommand=''
SettingsWindresCommand=''
TargetArch_CPP='i386'
TargetOS_CPP='linux'
TargetPlatform='i386-unknown-linux'
TargetPlatformFull='i386-unknown-linux'
TargetPlatform_CPP='i386_unknown_linux'
TargetVendor_CPP='unknown'
WhatGccIsCalled='/usr/bin/gcc'
WordSize=''
ac_ct_CC='/usr/bin/gcc'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='/usr/doc/ghc-7.6.2'
dvidir='${docdir}'
exec_prefix='NONE'
exeext=''
fp_prog_ar=''
hardtop='/tmp/SBo/ghc-7.6.2'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='/usr/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='/usr/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
soext='.so'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "The Glorious Glasgow Haskell Compilation System"
#define PACKAGE_TARNAME "ghc"
#define PACKAGE_VERSION "7.6.2"
#define PACKAGE_STRING "The Glorious Glasgow Haskell Compilation System 7.6.2"
#define PACKAGE_BUGREPORT "glasgow-haskell-bugs@haskell.org"
#define PACKAGE_URL ""

configure: exit 77
dono what to figure in this also this is not first time but had faced several times when i try install the packages that checks for the C complier... referred this thread too.. gotcha no idea..

thanks for the help in advance..
 
Old 11-27-2013, 04:06 PM   #2
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 291

Rep: Reputation: 55
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.

Last edited by selfprogrammed; 11-27-2013 at 04:09 PM.
 
1 members found this post helpful.
Old 11-27-2013, 09:18 PM   #3
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Posts: 765

Rep: Reputation: 196Reputation: 196
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/

Last edited by jkirchner; 11-27-2013 at 09:20 PM.
 
Old 11-28-2013, 12:31 AM   #4
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by jkirchner View Post
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.
yup i did a full installation..

Quote:
Originally Posted by jkirchner View Post
How are you installing GHC, are you using SlackBuilds? See this site for more http://slackbuilds.org/
I do downloaded almost all the packages from slackbuilds.org
 
Old 11-28-2013, 01:11 AM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Can you compile a simple C program? Copy the below code into a file called hello.c:

Code:
#include <stdio.h>

int main(void)
{
   puts("Hello, world.");
   return 0;
}
And then try to compile and run the file:

Code:
gcc hello.c -o hello
./hello
Does this work? If not, what error do you get. If it works OK, then your compiler seems to be set up correctly.
 
Old 11-28-2013, 01:18 AM   #6
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by selfprogrammed View Post
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.
Actually, i did a full installation for which i should have got all those development packages installed right away at my start.
Quote:
Originally Posted by selfprogrammed View Post
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.
It would be much helpful how to check `em out whether i have got installed or not. anyhow, i found them out at my slackware.iso and got no idea at which directory to install, if i am supposed to do again..!

Quote:
Originally Posted by selfprogrammed View Post
You could also use a programming editor (something better than Write).
Unless you already know EMACS, do not install EMACS.
got installed vi editor..


Quote:
Originally Posted by selfprogrammed View Post
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.
I did those compliation at /usr/local/src as root.. Since i did compilation at /usr/local/src is it required to instal those packages again in this..???

Quote:
Originally Posted by selfprogrammed View Post
Once this works you can move on to package requirements, which usually involve additional libraries that must be installed.
\
additional libraries in the sense you mean??
 
Old 11-28-2013, 01:28 AM   #7
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by btmiller View Post
Can you compile a simple C program? Copy the below code into a file called hello.c:

Code:
#include <stdio.h>

int main(void)
{
   puts("Hello, world.");
   return 0;
}
And then try to compile and run the file:

Code:
gcc hello.c -o hello
./hello
Does this work? If not, what error do you get. If it works OK, then your compiler seems to be set up correctly.
i did this, Just correct me if i have done any mistakes!!
Code:
root@slappisMekaniker:/home/slacker# cd /usr/local/src
root@slappisMekaniker:/usr/local/src# simple.c
bash: simple.c: command not found
root@slappisMekaniker:/usr/local/src# make simple.c
make: *** No rule to make target `simple.c'.  Stop.
root@slappisMekaniker:/usr/local/src# cp /home/slacker/Documents/computer/Linux/simple.c /usr/local/src
root@slappisMekaniker:/usr/local/src# gcc ./simple.c 
./simple.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
root@slappisMekaniker:/usr/local/src#
 
Old 11-28-2013, 06:03 AM   #8
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by selfprogrammed View Post
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.
After googling a while and came across the command pkgtool which i almost forgot to use it then i just found gcc and all other requirements as you stated are installed. I could also able to figure out the stdio.h and similar header files in the directory as usr/lib/gcc/i486-slackware-linux/4.71/include/ssp/stdio.h Well, creating symlink can solve the problem i hope..

Last edited by slappisMekaniker; 11-29-2013 at 12:52 AM. Reason: spelling mistake
 
Old 11-28-2013, 08:25 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
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.

Last edited by jpollard; 11-28-2013 at 08:28 AM.
 
Old 11-29-2013, 01:01 AM   #10
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by jpollard View Post
You have an old installation kit.
An old installation kit?? Could you please elaborate??
 
Old 11-29-2013, 05:04 AM   #11
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
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.
 
Old 11-29-2013, 05:49 PM   #12
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 291

Rep: Reputation: 55
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.

Last edited by selfprogrammed; 11-29-2013 at 05:59 PM.
 
2 members found this post helpful.
Old 11-29-2013, 09:53 PM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
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)
 
Old 11-29-2013, 11:18 PM   #14
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by selfprogrammed View Post

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
I have tested this and it returned,
Code:
root@slappisMekaniker:/usr/local/src# gcc simple.c -o simple.o
simple.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
root@slappisMekaniker:/usr/local/src# make simple
cc    -c -o simple.o simple.c
simple.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
make: *** [simple.o] Error 1
root@slappisMekaniker:/usr/local/src# make simple.o
cc    -c -o simple.o simple.c
simple.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
make: *** [simple.o] Error 1
root@slappisMekaniker:/usr/local/src#
Quote:
Originally Posted by selfprogrammed View Post
Your <stdio.h> should be in /usr/include/, the standard place for gcc to search for include files.
As i stated above stdio.h not lies in the /usr/include/, but this too have the header files but not all of them. Most of the header files lies in this area usr/lib/gcc/i486-slackware-linux/4.71/include/ssp/

So what should i do to fix the above and below problem..?

Quote:
Originally Posted by selfprogrammed View Post
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.
 
Old 11-30-2013, 06:15 AM   #15
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Posts: 765

Rep: Reputation: 196Reputation: 196
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?

Last edited by jkirchner; 11-30-2013 at 06:18 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a Distro that is Lightweight but has COMPILER that works! Cyanaether22 Linux - Software 10 05-08-2009 03:58 AM
Is there a C++ compiler in the FC6 distro that actually works? fc6_user Programming 31 02-08-2007 06:58 PM
Turbo C and C++ works on Linux and if so which compiler and editor is available. benoy4007 Red Hat 2 08-14-2004 09:13 AM
checking whether the C compiler (gcc ) works... no Transition Linux - Newbie 19 07-01-2004 04:04 AM


All times are GMT -5. The time now is 01:22 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration