cannot compile a simple c program [solved]

Booting, installing, newbie
Post Reply
Message
Author
solex
Posts: 65
Joined: Fri 05 Sep 2014, 13:39

cannot compile a simple c program [solved]

#1 Post by solex »

I'm trying to compile a simple hello world c program.

I issue the command

# gcc hello.c

resulting in
/user/libexec/gcc/x86_64-slackware-linux/5.3.0/cc1: error while loading libraries: libmpc.so.3: cannot open shared object file: No such file or directory

I'm running Slacko 6.9.9.9 and also have the same problem with 6.9.6.4.

Thank you
Last edited by solex on Tue 25 Jul 2017, 10:39, edited 1 time in total.

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#2 Post by rcrsn51 »

Is this a 32bit version of Slacko? Do you have the 64bit devx loaded by mistake?

solex
Posts: 65
Joined: Fri 05 Sep 2014, 13:39

#3 Post by solex »

In both instances I have the 64-bit version of Slacko

This is the ISO I used for 6.9.9.9

slacko64-6.9.9.9-uefi-k4.9-FF-LO.iso

Dan

solex
Posts: 65
Joined: Fri 05 Sep 2014, 13:39

#4 Post by solex »

I reinstalled libmpc-1.0.3 PPM reported it was already installed. I tried to find libmpc prior and could not.

After the install I got further along the compiler now states:

fatal error: stdio.h: No such file or directory
compilation terminated

I'm guessing a path problem

export $PATH

bash: export: '/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/root/my-applications/bin:user/games' : not a valid identifier

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#5 Post by rcrsn51 »

I have Slacko64 6967 and its devx. I did a clean install. I tested gcc. It works fine.

solex
Posts: 65
Joined: Fri 05 Sep 2014, 13:39

#6 Post by solex »

Sorry what does devx mean is it a pet i need to install or is it another iso? Seems strange the gcc would be partially installed

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#7 Post by rufwoof »

The DevX contains all of the compiling programs that are excluded from the main distro.

You need to download the relevant devx for your version ... so perhaps here (note that is the 32 bit version, if you're running a different choice (64 bit perhaps?) then usually the provider posts where the devx can be obtained from alongside where they post the link to the puppy download) and once downloaded you can usually load it by right clicking on the file and select something like sfs_load

After loading you'll be able to use all of the compile/build tools

For some programs you might also need the kernel sources ... which again the provider usually posts a link to, and again a matter of loading that sfs in a similar manner.

EDIT : it does look like the 64 bit you've got (I went up to the Parent Folder from the above link and then down into the 64 directory), so the devx you require is probably here and you want the file called devx_slacko64_6.9.9.9.sfs that is just under 140MB in size

Remember that after you cc helloworld.c that will produce a a.out file (if it correctly compiles). Rename that a.out to helloworld and make it executable (chmod a+x helloworld) and then you can run it ./helloworld
Last edited by rufwoof on Mon 24 Jul 2017, 01:28, edited 1 time in total.

solex
Posts: 65
Joined: Fri 05 Sep 2014, 13:39

#8 Post by solex »

Thank you RufWoof will download and give it a try

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#9 Post by bigpup »

Seems strange the gcc would be partially installed
Only what is needed to run programs is in the main Puppy iso.

Also,
sfsget entered in a terminal, should bring up the needed devx to download and load.

Place the devx sfs in /mnt/home
Load it by using SFS load-on-the-fly program found in menu->Setup->


If you are only running and installing programs, the stuff in the devx and the kernel sources are not needed, so why put them in Puppy iso and make it twice the size.

In a Puppy frugal install, sfs packages are easy to load and unload from the file system.
They are not actually installed, but loaded into the file system, to use, and unloaded when not needed.
Keeps Puppy small and fast.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

solex
Posts: 65
Joined: Fri 05 Sep 2014, 13:39

#10 Post by solex »

Got it BigPup, makes perfect sense. Thanks

solex
Posts: 65
Joined: Fri 05 Sep 2014, 13:39

#11 Post by solex »

Thank you all, loading the 6.9.9.9 devx worked

Post Reply