LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-15-2012, 01:02 PM   #1
Iuz
LQ Newbie
 
Registered: Sep 2012
Location: Brazil
Distribution: Slackware
Posts: 22

Rep: Reputation: Disabled
What is wrong with my GCC?


Trying to install some slackbuilds Im getting the same error all the time:

configure: error: in `/tmp/SBo/mono-2.10.9':
configure: error: C compiler cannot create executables

Same thing happened with code::blocks, LÍVE configure...

Mono config.log
http://pastebin.com/vD5bHAvw

code::blocks config.log
http://pastebin.com/u2b3tMMn

also trying to compile things (not sure if this is related):

# gcc -o prog3 prog3.c
prog3.c:1:19: fatal error: stdio.h: No such file or directory

with:

find /usr -name stdio.h
/usr/src/linux-3.2.29/arch/powerpc/boot/stdio.h
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/include/ssp/stdio.h
/usr/lib64/bcc/include/stdio.h
/usr/include/isc/stdio.h
/usr/include/c++/4.7.1/tr1/stdio.h

Im no expert and have no idea what is going on...
 
Old 11-15-2012, 01:37 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,970

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Hi,

possibly the architecture isn't recognized correctly. If you build for 64bit, please check if the slackbuildscript is able to recognize this architecture. Otherwise change it in the Slackbuildscript.

Markus
 
Old 11-15-2012, 02:10 PM   #3
bosth
Member
 
Registered: Apr 2011
Posts: 219

Rep: Reputation: 62
Missing glibc? Try (re)installing that package.
 
Old 11-15-2012, 04:50 PM   #4
ssl779
Member
 
Registered: Oct 2012
Distribution: Slackware since 1995, switched to Arch in 2012
Posts: 39

Rep: Reputation: Disabled
Quote:
Originally Posted by Iuz View Post

find /usr -name stdio.h
/usr/src/linux-3.2.29/arch/powerpc/boot/stdio.h
/usr/lib64/gcc/x86_64-slackware-linux/4.7.1/include/ssp/stdio.h
/usr/lib64/bcc/include/stdio.h
/usr/include/isc/stdio.h
/usr/include/c++/4.7.1/tr1/stdio.h

Im no expert and have no idea what is going on...
I would expect to find stdio.h in "/usr/include".
What distro do you use?
Have you installed complete gcc suite?
 
Old 11-15-2012, 04:54 PM   #5
Iuz
LQ Newbie
 
Registered: Sep 2012
Location: Brazil
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
slackware 14.0 64...
It should come with the installation right?

I also installed http://www.slackware.com/~alien/multilib/14.0/ and Im feeling I did something wrong here...
 
Old 11-15-2012, 06:00 PM   #6
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 3,951

Rep: Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930
As pointed out by bosth, /usr/include/stdio.h is provided by glibc, which should be installed. Did you make a full install?

Also, check that all your packages are for x86_64. Following command should return 0:
Code:
ls -l /var/log/packages | grep i486 | wc -l
 
Old 11-15-2012, 06:04 PM   #7
ssl779
Member
 
Registered: Oct 2012
Distribution: Slackware since 1995, switched to Arch in 2012
Posts: 39

Rep: Reputation: Disabled
Quote:
Originally Posted by Iuz View Post
slackware 14.0 64...
It should come with the installation right?
If you did full installation then yes.
But if you chose custom package selection then you had to select binutils, gcc, glibc, kernel headers, all this stuff...

btw, take a look into /var/log/packages to make sure they are actually installed.
As bosth suggested above, glibc is likely missing (package glib-1.2.10-x86_64-3, at least om my Slack)


Quote:
Originally Posted by Iuz View Post
I also installed http://www.slackware.com/~alien/multilib/14.0/ and Im feeling I did something wrong here...
Unlikely.
"/usr/include/stdio.h" should remain there...
 
Old 11-15-2012, 06:09 PM   #8
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-14.1 on a Lenovo T61 6457-4XG
Posts: 3,951

Rep: Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930Reputation: 930
Quote:
Originally Posted by ssl779 View Post
glibc is likely missing (package glib-1.2.10-x86_64-3, at least om my Slack)
It is glibc-2.15-x86_64-7.txz in the /l series of packages
 
Old 11-15-2012, 06:20 PM   #9
ssl779
Member
 
Registered: Oct 2012
Distribution: Slackware since 1995, switched to Arch in 2012
Posts: 39

Rep: Reputation: Disabled
Quote:
Originally Posted by Didier Spaier View Post
It is glibc-2.15-x86_64-7.txz in the /l series of packages
Yes, it comes from this package. Then in /var/log/packages there must be a corresponding file
"glib-2.15-x86_64-<some number>".
Also, if he successfully installed multilibs there will be another file like "glibc-2.15_multilib-x86_64-7alien",
which substitutes /usr/include/stdio.h, but in any case it must be there.
 
Old 11-15-2012, 06:34 PM   #10
Iuz
LQ Newbie
 
Registered: Sep 2012
Location: Brazil
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: Disabled
ls -l /var/log/packages | grep i486 | wc -l returned 0 and yes, I did a full install

and on /var/log/packages:

-rw-r--r-- 1 root root 1436 02.10.2012 16:56 glib-1.2.10-x86_64-3
-rw-r--r-- 1 root root 7416 02.10.2012 16:56 glib-networking-2.32.3-x86_64-1
-rw-r--r-- 1 root root 43781 02.10.2012 16:56 glib2-2.32.4-x86_64-1
-rw-r--r-- 1 root root 210 22.10.2012 02:40 glibc-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 2287 16.11.2012 19:22 glibc-debug-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 464815 22.10.2012 02:41 glibc-i18n-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 1303 22.10.2012 02:41 glibc-profile-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 15553 22.10.2012 02:41 glibc-solibs-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 69793 22.10.2012 02:41 glibc-zoneinfo-2012f_

I still have no idea on what seems to be the problem
 
Old 11-15-2012, 10:15 PM   #11
lkraemer
Member
 
Registered: Aug 2008
Posts: 111

Rep: Reputation: 10
Iuz,
Your problem is likely that your environment isn't set properly.

To find those settings you can type the following commands:
Code:
env
env | grep SHELL=
The command "env" Displays the current environment, and one of those items is the PATH. Here is my Slackware 14 (32 Bit) path:
Quote:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/kde4/libexec:/usr/lib/qt/bin:/usr/share/texmf/bin:.:/home/larry/bin:/usr/sbin
The command "env | grep SHELL=" displays what Shell is being used. Bash is default for Slackware 14.

REF:
http://en.wikipedia.org/wiki/Unix_shell
Bourne shell (sh)
Almquist shell (ash)
Bourne-Again shell (bash)
Debian Almquist shell (dash)
Korn shell (ksh)
Z shell (zsh)
C shell (csh)
TENEX C shell (tcsh)
other shells..............


The next thing to do is determine if there is a .*rc file, or a .bash_profile file.

To find the current logged in user's home shell Configuration file (*rc)... use:
Code:
man updatedb
updatedb
cd ~
locate .*rc
locate .bash_p*
One (or more) of the above files should exist.


There may be a .bash_profile file in /home/loginuser along with .bashrc. You can put configurations in either file,
and you can create either if it doesn’t exist. But, why two different files? What is the difference?

According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for
interactive non-login shells.

If .bash_profile exists in /home/user/ with the following information already inserted:
Code:
  PATH=$PATH:$HOME/bin
  export PATH
just append your path modifications here instead of the .bashrc file. (ie. CentOS 6 Distro)

You need to list the *rc file to verify the contents and set the PATHS. I'm ASSUMING a Bash shell......Your may be different!
Code:
cat .bashrc
cat .bashrc -- Lists the configuration file, then you must append the proper search paths for the users shell with edit.
Quote:
export LD_LIBRARY_PATH=????????????????????????????????
export LIBRARY_PATH=???????????????????????????????????
export C_INCLUDE_PATH=?????????????????????????????????
export CPATH=??????????????????????????????????????????
My Debian Distro happens to be:
Quote:
export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
export LIBRARY_PATH=/usr/lib:/usr/local/lib
export C_INCLUDE_PATH=.:/usr/include:/usr/local/include
export CPATH=.:/usr/include:/usr/local/include
But yours may vary accordingly. You won't be able to cut & paste mine, unless your system is built exactly like mine.
It's up to you to locate exactly where all the libs, and includes are located. That is what all the previous commands
should have helped you do. Just because you have /usr/lib & /usr/local/lib included....doesn't mean your needed lib is
in that path.

That is where your detective work comes to play. SEARCH and use grep to locate the libs.

Once you have the env file set either reboot or reset the env. Once again, your system command for this
can/may be different.

Code:
source .bashrc
This command resets the environment to what you need for Compiles, assuming the SHELL is bash. This may not be available on your system.....

REF:
http://linux.about.com/library/cmd/blcmdl1_ulimit.htm

Quote:
source filename [arguments]
Read and execute commands from filename in the current shell environment and return the exit status of the last command executed from filename. If filename does not contain a slash, file names in PATH are used to find the directory containing filename. The file searched for in PATH need not be executable. When bash is not in posix mode, the current directory is searched if no file is found in PATH. If the sourcepath option to the shopt builtin command is turned off, the PATH is not searched. If any arguments are supplied, they become the positional parameters when filename is executed. Otherwise the positional parameters are unchanged. The return status is the status of the last command exited within the script (0 if no commands are executed), and false if filename is not found or cannot be read.
A quick and easy way is to append the desired directory to the PATH variable located on your .bashrc file.
Code:
echo "PATH=$PATH:/home/jacob/Dakota/bin" >> .bashrc
The command below should find several copies of stdio.h.
Code:
find /usr -iname "stdio.h"
Here is what was found on my Slackware 14 (32 Bit) Full install.

Quote:
/usr/include/stdio.h
/usr/include/isc/stdio.h
/usr/include/bits/stdio.h
/usr/include/wine/msvcrt/stdio.h
/usr/include/c++/4.7.1/tr1/stdio.h
/usr/lib/gcc/i486-slackware-linux/4.7.1/include/ssp/stdio.h
/usr/lib/bcc/include/stdio.h
/usr/src/linux-3.2.29/arch/powerpc/boot/stdio.h
bash-4.2$
For the test program named hello.c you just need to compile it and execute it with:
Code:
/*	HELLO.C -- Hello, world */

#include <stdio.h>

main()
{
int i;
i = 0x10;
/* comment   */
	printf("Hello, World.....Interrupt used was %d\n",i);
}
Code:
gcc -o hello hello.c
./hello
assuming the proper file permissions are set:
Quote:
bash-4.2$ ls -alt hello*
-rwxr-xr-x 1 larry users 6084 Nov 16 03:39 hello
-rw-r--r-- 1 larry users 150 Nov 16 03:38 hello.c
bash-4.2$
giving the following result:
Quote:
bash-4.2$ ./hello
Hello, World.....Interrupt used was 16
bash-4.2$
What did you find set incorrect?



Larry

Last edited by lkraemer; 11-15-2012 at 10:38 PM.
 
Old 11-15-2012, 10:56 PM   #12
ssl779
Member
 
Registered: Oct 2012
Distribution: Slackware since 1995, switched to Arch in 2012
Posts: 39

Rep: Reputation: Disabled
Larry, everything you said above is correct.
But, it would be his next step.
For now he is missing /usr/include/stdio.h - the glibc header which is expected by gcc.
It comes from glibc-2.15-x86_64-7.txz.
As Didier mentioned, it is in the /l series, so I guess step one is go into directory slackware64/l of installation CD and run "installpkg glibc-2.15-x86_64-7.txz"

Quote:
Originally Posted by Iuz View Post
# gcc -o prog3 prog3.c
prog3.c:1:19: fatal error: stdio.h: No such file or directory
btw, a silly question - which way do you include it?
#include "stdio.h", or
#include <stdio.h> ?
(note angle brackets vs quotation marks)
 
Old 11-15-2012, 11:17 PM   #13
ssl779
Member
 
Registered: Oct 2012
Distribution: Slackware since 1995, switched to Arch in 2012
Posts: 39

Rep: Reputation: Disabled
Quote:
Originally Posted by Iuz View Post
... and on /var/log/packages:
...
-rw-r--r-- 1 root root 210 22.10.2012 02:40 glibc-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 2287 16.11.2012 19:22 glibc-debug-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 464815 22.10.2012 02:41 glibc-i18n-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 1303 22.10.2012 02:41 glibc-profile-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 15553 22.10.2012 02:41 glibc-solibs-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 69793 22.10.2012 02:41 glibc-zoneinfo-2012f_
oh, I see you have multilib installed. In this case please disregard my advice about glibc-2.15-x86_64-7.txz,
you have to reinstall glibc-debug-2.15_multilib-x86_64-7alien from Alien's packages.
 
Old 11-15-2012, 11:24 PM   #14
ssl779
Member
 
Registered: Oct 2012
Distribution: Slackware since 1995, switched to Arch in 2012
Posts: 39

Rep: Reputation: Disabled
sorry, a mistake - I mean "glibc-2.15_multilib-x86_64-7alien",
not the "-debug-" version
 
Old 11-15-2012, 11:27 PM   #15
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,970

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Quote:
Originally Posted by Iuz View Post
ls -l /var/log/packages | grep i486 | wc -l returned 0 and yes, I did a full install

and on /var/log/packages:

-rw-r--r-- 1 root root 1436 02.10.2012 16:56 glib-1.2.10-x86_64-3
-rw-r--r-- 1 root root 7416 02.10.2012 16:56 glib-networking-2.32.3-x86_64-1
-rw-r--r-- 1 root root 43781 02.10.2012 16:56 glib2-2.32.4-x86_64-1
-rw-r--r-- 1 root root 210 22.10.2012 02:40 glibc-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 2287 16.11.2012 19:22 glibc-debug-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 464815 22.10.2012 02:41 glibc-i18n-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 1303 22.10.2012 02:41 glibc-profile-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 15553 22.10.2012 02:41 glibc-solibs-2.15_multilib-x86_64-7alien
-rw-r--r-- 1 root root 69793 22.10.2012 02:41 glibc-zoneinfo-2012f_

I still have no idea on what seems to be the problem
I would like to see the Slackbuildscript, the part where the architecture is initialized, I suppose as I wrote above that it doesn't recognize that you have a 64bit architecture.

I know this type of error, it's likely related to the architecture.

Markus

Last edited by markush; 11-15-2012 at 11:29 PM.
 
  


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
Wrong version of gcc -- how do I change it? AKviking Linux - Software 1 08-15-2009 10:26 PM
wrong to compile the gcc-4.1.2,everyone could help me . panger123 *BSD 3 08-14-2008 10:58 PM
Wrong GCC version replica9000 Linux - Software 6 09-04-2007 03:04 PM
Missing gcc or wrong version NoobVer.01 Fedora - Installation 1 08-19-2005 02:00 AM
something wrong with gcc freemind Linux - Newbie 18 04-30-2003 08:12 PM


All times are GMT -5. The time now is 08:16 PM.

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