Jump to content

Unable to compile using GCC or CC [solved]


Recommended Posts

Hi,

 

I have recently installed Mandriva Limited Edition 2005 for AMD64 and I have been unable to use GCC/CC to compile even a simple hello world example in C.

 

I installed GCC using #rpmi gcc in a Konsole and currently have the following packages:

 

gcc-3.4.3-7mdk

gcc-c++-3.4.3-7mdk

gcc-cpp-3.4.3-7mdk

 

When trying to configure packages, or even with a simple hello world .c file

using this line:

 

#gcc -otest test.c

 

I receive the following error:

 

gcc: installation problem, cannot exec `cc1': No such file or directory

 

I have seen similar problems in other threads, but they don't seem to have been solved - this is driving me mad, any help would be greatly appreciated.

 

 

[moved from Software by spinynorman - welcome aboard :)]

Edited by scaryfast
Link to comment
Share on other sites

use urpmf to find what pkg the missing file is in :D

localhost:/# urpmf cc1

libgcc1:/lib/libgcc_s-3.4.3.so.1

libgcc1:/lib/libgcc_s.so.1

gcc-cpp:/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.3/cc1

and then install with urmpi gcc-cpp

no need for the internet and much faster :P

Link to comment
Share on other sites

I have searched again (using Find File) after turning off my machine for the evening, and - joy of joys - the file exists! :D

 

It's in:

 

/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.4

 

I still get "cannot exec `cc1': No such file or directory" though, so now I assume it's a $PATH thing?

 

Now what?!

Link to comment
Share on other sites

No it's a wrong package thing :)

 

It should be in: /usr/bin/x86_64-mandrake-linux-gnu/3.3.4

 

You've installed 'Mandriva Limited Edition 2005 for AMD64' so you should install the gcc packages for Mandriva x86_64. It's in main ( http://www.mandriva.com/products/limited-e...ve_x86-64_1-dvd ) so make sure you've added that as one of your repositories.

Link to comment
Share on other sites

The mystery unravels - thanks for your time :D

 

I can only find one CD iso for the x86_64 version, and Easy Urpmi only gives me two sources (free/non-free plf) for packages when I specify AMD64.

 

I have had problems with Python in Superkaramba too, so I'm thinking I might have munged everything...

 

Would you recommend downloading the i586 DVD and starting from scratch?

 

If so, how would I do this, and could I salvage anything (like my amaroK database and stuff)?

Edited by scaryfast
Link to comment
Share on other sites

That is not neccesary. The easy urpmi site gives only links that have been fed into it (it's not an official mandriva tool) so there are repositories for main, contrib etc for x86_64 ( for example: http://ftp.surfnet.nl/ftp/pub/os/Linux/dis...5/x86_64/media/ ). You just have to add them manualy. Open the MCC, software, media management and add the urls for main, contrib etcetc.

 

The is no free DVD iso.

 

The default amarok database is kept in /home/<your name>. (if you use mySQL it's different. You need to make a backup). Reinstalling without formatting /home will keep all your user data (disclaimer: only if you keep all your user data in /home :) )

Link to comment
Share on other sites

That means you need to install a package that includes the iostream.h file. Xxxxx.h files are header files and can be found in xxxx-devel packages (where xxxx is the name of an application). With the site from my earlier post you can find what devel-package needs to be installed (but make sure it's one for x86_64 :) )

Link to comment
Share on other sites

Cool - that worked for my .c hello world, but for a .cc one that looks like this:

#include <iostream>
 int main()
   {
   cout << "Hello, World\n";
   return -1;
   }

I get:

 

error: `cout' undeclared (first use this function)

error: (Each undeclared identifier is reported only once for each function it appears in.)

 

I promise, I'll run out of problems soon. B)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...