LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-06-2013, 05:53 AM   #31
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: LinuxMint
Posts: 775

Rep: Reputation: 199Reputation: 199

I have to agree with Spect73. I tried helping earlier in this thread but was at a loss. I really think it is either not a full install of Slackware or something is corrupted. I have never had an issue compiling c programs after a full install of Slackware (used it since 10.2). I think a fresh install would be the best approach here.
 
1 members found this post helpful.
Old 12-07-2013, 08:19 AM   #32
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
First of all I would like to thank you a lot Spect73 and also selfprogrammed, jkirchner ofcourse!! you people really boost my interest and I feel encouraged when you people(all the one who posted a reply for my thread) that was a great experience in learning slackware. I think I have placed a stone that would help me building a castle... I am really excited!! Thank you all once again considering my thread...
 
Old 12-07-2013, 08:40 AM   #33
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Spect73 View Post
You replied 'no way'. Since that time, only more difficulties have arisen.
of course "no way" in the sense, it is that I'm not lazy to do that again..(no offense!!). But I'm just trying to repair the installation of packages just by figuring out what the problem is...from as the way of what, now my current state of the system is... (I believe this would still gimme some potential to explore more of what is what!) That's it!! But I failed on the part how to figure out the problem, lots of googling and reading howto's regarding of these two threads which left me with unsatisfying answers. So then I reached for help from you noble hearts... And I would definitely would try reinstalling after Backing up and some googling on reinstallation...
 
Old 12-07-2013, 04:36 PM   #34
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 306

Rep: Reputation: 63
I tracked all the problems with the compiler to missing the one package,
the development glibc (on my system glibc-2.13-i486-5_slack13.37 ). It must be on your Slackware distribution disks so it should be easy to install it (look in the dev packages).

A total reinstall might only recreate the current situation, because we do not know how it occurred during the first install. Despite all belief, just retrying something does not give different results. Something must differ, like not making the same mistakes.
Slackware supports installing and reinstalling individual packages, so I would advise doing that unless you detect whole groups of missing or mis-installed packages.
I do not like the Windows basic technique of re-install everything as a way to fix problems.

The GREP question may only my misunderstanding your response to the test. There are times that grep does not respond with anything.

Are there any other problems that would indicate it is more widespread ??

Last edited by selfprogrammed; 12-07-2013 at 04:44 PM.
 
1 members found this post helpful.
Old 12-07-2013, 07:13 PM   #35
Spect73
Member
 
Registered: Aug 2013
Distribution: Slackware 14.1
Posts: 128

Rep: Reputation: Disabled
Quote:
Originally Posted by selfprogrammed View Post
I tracked all the problems with the compiler to missing the one package,
the development glibc (on my system glibc-2.13-i486-5_slack13.37 ). It must be on your Slackware distribution disks so it should be easy to install it (look in the dev packages).

A total reinstall might only recreate the current situation, because we do not know how it occurred during the first install. Despite all belief, just retrying something does not give different results. Something must differ, like not making the same mistakes.
Slackware supports installing and reinstalling individual packages, so I would advise doing that unless you detect whole groups of missing or mis-installed packages.
I do not like the Windows basic technique of re-install everything as a way to fix problems.

The GREP question may only my misunderstanding your response to the test. There are times that grep does not respond with anything.

Are there any other problems that would indicate it is more widespread ??
In 1972 I was taught that the first rule of troubleshooting a computer was to find a known good starting point. That is the reason for a re-install. Every company that built a machine I worked on used it. It might not clear all problems, as one can goof up an install. Perhaps it might even be considered "non-elegant". It works. That technique predates Uncle Bills' products by a few decades. Don't give him credit for innovation.

I have __NEVER__ used Microsoft Windows software on a personal computer. CP/M, DOS, OS/2, FreeBSD, NETBSD, Slackware and a few other Linux distros on the "IBM compatibles". The native OS on the Commodores, Ataris, Wang Laboratories, and all the myriad machines I've bought over the years. Every machine I've owned, regardless of the OS being used, has eventually had that OS re-installed. Sometimes that is the only way to recover. At other times, it may just be the "Easier/Softer Way".

More importantly to this forum, "Linux Newbie", I think is the need to assume that a poster may not have the experience level you have. The OP has expressed a strong desire to learn. Commendable. Yet my years of teaching have taught me one very important thing: a student must have some small degree of success or they will get frustrated and quit. Probably as important, I have noticed that the folks attempting to help someone must get a degree of cooperation from the person needing help or they give up. It is the give and take of social intercourse.

Tis a beautiful, snowy Saturday night. My box of Slackware 14.1 disks are calling to be used. SO, I'll use them. But, I won't be doing a mere 'upgrade' at all. I'll take everything down and do a complete install. Then, if I have any problems, I have that 'known good starting point'.
 
Old 12-08-2013, 12:48 AM   #36
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Spect73 View Post
This will not work on Slackware 14 which is what slappisMekaniker said he installed. That first line compiles the program to a fully executable image and outputs it to a file named simpler.o. It does not just create an object file. Running that second line will produce tons of errors about having multiple definitions. The errors are correct as the source file has already been compiled to an object code format and the final linking has been done. To compile simpler.c to an object file, the command "gcc -c simpler.c" would be used.

I've used Slackware for many years and don't ever remember it failing to produce an executable when given that first line, as that line is written. Just to verify all that I've said, I just did it.

Coordially,
Hopefully I was reading all the post and I was searching that had I missed any valid points in trying to tinker my system and found that I did missed this post!! So I executed the command "gcc -c simple.c" returned no error and created another file called simple.o in the place where the file simple.c lies and the content of the file goes like this
Quote:
int main(void)
{
int i = 1234;
return i;
}
Quote:
slacker@slappisMekaniker:~/Documents$ gcc -c simple.c
slacker@slappisMekaniker:~/Documents$
without any headers

But the same when I edit the file with a header like this
Quote:
#include<stdio.h>

main()
{
printf("hello world \n");
return 0;
}
as quoted by btmiller and selfprogrammed;
I got this same error like before what I got!!
Quote:
slacker@slappisMekaniker:~/Documents$ gcc -c simple.c
simple.c:1:18: fatal error: stdio.h: No such file or directory
compilation terminated.
I think the problem lies exactly that compiler could not find the location of the header files..

Am I correct??

Last edited by slappisMekaniker; 12-08-2013 at 01:02 AM.
 
Old 12-08-2013, 05:09 AM   #37
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: LinuxMint
Posts: 775

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by slappisMekaniker View Post
But the same when I edit the file with a header like thisas quoted by btmiller and selfprogrammed;
I got this same error like before what I got!! I think the problem lies exactly that compiler could not find the location of the header files..

Am I correct??
Yes, I believe so. Now, in my opinion, this shows that something has changed/corrupted in your installation. I honestly think the best way to proceed is to back-up personal files and do a fresh, new, full install of Slackware. It is good you want to find/fix the issue but if this much is wrong now, who knows if you will find/fix all that needs to be done? I think a reinstall is the most thorough and simplest fix at this point.
 
Old 12-08-2013, 05:45 AM   #38
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Try this, as root:
Code:
slackpkg update
then:
Code:
slackpkg reinstall glibc
Then try compiling that program again.
 
Old 12-08-2013, 06:01 AM   #39
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
Quote:
Originally Posted by brianL View Post
Try this, as root:
Code:
slackpkg update
then:
Code:
slackpkg reinstall glibc
Then try compiling that program again.
And if that doesn't work, try reinstalling the compiler...

and look for ccache as being in the loop - you might need to do a "ccache -C" if things have gotten a little loopy. ccache is used to try and optimize gcc runtime - but to do it requires it to cache the results of some operations. If some of its stored cache happens to be corrupted for some reason you can get strange persistent errors. The -C option is supposed to flush all of the cached files.
 
Old 12-08-2013, 11:50 PM   #40
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
I did a slackpkg update and now my all file managers stopped working and most of the shortcuts too... At this point most of you are right and I am just not going to waste your time by trying the last option reinstall the whole os!!! Any how after reinstalling I ll just post about the status of my system.. Thanking you all, once again for considering my query!!

Last edited by slappisMekaniker; 12-08-2013 at 11:53 PM.
 
Old 12-09-2013, 12:27 AM   #41
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
Well... that could be caused by not having the ld.so.cache file not get rebuilt when it should.

Especially if you haven't rebooted in a while. The updates would have replaced the share libraries, but the mapping table in the cache wouldn't have been updated... but if the original files get deleted, the running applications just might hang....
 
1 members found this post helpful.
Old 12-10-2013, 02:46 PM   #42
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37
Posts: 306

Rep: Reputation: 63
I presume that like myself, you would prefer to know the cause of the problem, rather than performing some rote operation, or being told to try rebooting first. Well, this is one of those cases where we know why rebooting works.

Installing libc libraries without updating ld cache will do that. Unfortunate for you that glibc reinstalls the libc libraries too. The libc library is also installed by the basic library Slackware package (it is rather important to every program). Because matching the headers to the library is so important, the glibc package is reinstalling the libc so it exactly matches the headers it is installing. This throws off the loader.

Everyone forgets to update the loader cache, and we also forgot to warn you.

Linux fixes itself after reboot, because booting does a library update scan.
This only happens during install, and the install instructions tell users to reboot after
install (for this reason). Installing any library can cause this, but only libc will affect so much of Linux. Installing other libraries and not updating the cache will only cause problems for the programs trying to use the new library. When after a reboot programs mysteriously start working, that is the most likely reason.

This happens because the library loader (ld) keeps a cache of library file locations that it uses to quickly handle program requests for run-time linking.

The command to update the library cache requires root to modify the cache:
>> /sbin/ldconfig
It is run with every boot.

This could easily be part of the script run by the package install.
For the number of times this problem arises, the Slackware package installer should be automating this.

Last edited by selfprogrammed; 12-10-2013 at 02:53 PM.
 
1 members found this post helpful.
Old 12-19-2013, 01:04 AM   #43
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Dear members,
Thankyou all for posting reply for my query!! And now as most of you suggested to reinstall the os I did it and i have compiled the simple.c as below
Quote:
bash-4.2$ gcc -c simple.c
successfully there wasn't any error... And I found another file named simple.o of type >>object code in the same directory.

It would be great if anybody point out the things so far I missed or that whether I have to check any other variables regarding this issue!!

Last edited by slappisMekaniker; 12-19-2013 at 01:11 AM.
 
Old 12-19-2013, 02:36 AM   #44
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,220

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
if it was made based on post #2 you can try the following:
gcc -o simple simple.c
./simple
it should print "Hello World" (or something like this).
Also you can try the command: make simple.

If all the above was ok you can try to start install ghc again
 
1 members found this post helpful.
Old 12-19-2013, 02:58 AM   #45
slappisMekaniker
Member
 
Registered: Nov 2013
Location: The Blue planet
Distribution: Slackware 14.0
Posts: 64

Original Poster
Rep: Reputation: 6
Thumbs up

Quote:
Originally Posted by pan64 View Post
if it was made based on post #2 you can try the following:
gcc -o simple simple.c
./simple
it should print "Hello World" (or something like this).
Also you can try the command: make simple.

If all the above was ok you can try to start install ghc again
That was cool! it worked well with no error! Although I didn't try resolving the problem by reinstalling the gcc or glibc packages i mark this post as solved..
 
  


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 02:58 AM
Is there a C++ compiler in the FC6 distro that actually works? fc6_user Programming 31 02-08-2007 05: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 08:13 AM
checking whether the C compiler (gcc ) works... no Transition Linux - Newbie 19 07-01-2004 03:04 AM


All times are GMT -5. The time now is 01:14 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