Topic: Problems building C (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=29707" title="Pages that link to Topic: Problems building C (Page 1 of 1)" rel="nofollow" >Topic: Problems building C <span class="small">(Page 1 of 1)</span>\

 
zavaboy
Paranoid (IV) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 11-23-2007 00:55

I'm trying to build this: http://kociemba.org/cube.htm
(Click on "Download", then towards the bottom there's a link to the C source.)

I extracted it and the tried running "make", but I didn't have gcc installed. So, I installed gcc (via Synaptic Package Manager) and tried again, and got this:

code:
server:/home/zavaboy/Desktop/Downloads/cube explorer# make
gcc -O3 -Wall -c cubiecube.c
cubiecube.c:4:20: error: string.h: No such file or directory
cubiecube.c:5:19: error: ctype.h: No such file or directory
cubiecube.c: In function ?stringToCubieCube?:
cubiecube.c:214: warning: implicit declaration of function ?strstr?
cubiecube.c:214: warning: incompatible implicit declaration of built-in function ?strstr?
cubiecube.c:215: error: ?NULL? undeclared (first use in this function)
cubiecube.c:215: error: (Each undeclared identifier is reported only once
cubiecube.c:215: error: for each function it appears in.)
cubiecube.c:216: warning: implicit declaration of function ?strlen?
cubiecube.c:216: warning: incompatible implicit declaration of built-in function ?strlen?
cubiecube.c:219: warning: implicit declaration of function ?toupper?
make: *** [cubiecube.o] Error 1


I don't understand why I'm getting all that. I don't even know what half of it means. Somebody please explain this and possibly give a solution.

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 11-23-2007 01:11

hmm...did you run ./configure first?

The typical way to install from source is :

./configure

make

make install

make clean

Without configuring the source to your build of linux, it usually fails with some wacky errors. At least it has for me.

You might need build-essentials as well. Not sure though.

Later,

C:\

zavaboy
Paranoid (IV) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 11-23-2007 04:54

The readme said just "make" should work.
I installed "build-essential" and then tried building it, this time with success.

Thanks, CPrompt!

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana
Insane since: Aug 2000

posted posted 11-23-2007 22:39
code:
cubiecube.c:4:20: error: string.h: No such file or directory
   This errorsays the compiler can't find 'string.h' in you include path. IF you have string.h on your system
   (for example, in /usr/include) the compiler can't find it. Did you install the standatd c libraties when you
   installed gcc?


cubiecube.c:5:19: error: ctype.h: No such file or directory
   This error is the same as the one above, just for a different include file.
   Your compiler can't find ctype.h.


cubiecube.c: In function ?stringToCubieCube?:
   I don't know about this error. It looks as if your code is making a call to a function that 
   should be defined in your code or another file in the code you downloaded from the 
   Rubic's Cube. It's possible you haven't downloaded the other file or the other errors
   are keeping this function from compiling.

   Don't worry about this error right now. When you fix the others, this one may go away.
   IF it doesn't, we'll worry about it when the others are fixed.


cubiecube.c:214: warning: implicit declaration of function ?strstr?
cubiecube.c:214: warning: incompatible implicit declaration of built-in function ?strstr?
   These errors are because the compiter was not able to find string.h. See above.




cubiecube.c:215: error: ?NULL? undeclared (first use in this function)
cubiecube.c:215: error: (Each undeclared identifier is reported only once
cubiecube.c:215: error: for each function it appears in.)
   These errors are because the compiler couldn't find ctype.h. See above.


cubiecube.c:216: warning: implicit declaration of function ?strlen?
cubiecube.c:216: warning: incompatible implicit declaration of built-in function ?strlen?
cubiecube.c:219: warning: implicit declaration of function ?toupper?
   These errors are because the compiter was not able to find string.h. See above.




You might also look on your system for strings.h. The names of the include files sometimes change from distribution to distribution

.



-- not necessarily stoned... just beautiful.


(Edited by hyperbole on 11-23-2007 22:43)

zavaboy
Paranoid (IV) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 11-23-2007 23:14

Yeah, you're about 8 hours too late. CPrompt said I may need build-essential, so I got it and it worked. Though thanks for explaining the errors!

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 11-23-2007 23:39
quote:

zavaboy said:

I installed "build-essential" and then tried building it, this time with success.



I still find it strange that they don't include this by default with distros. I just installed Debian and it doesn't have it either.

Glad it worked

Later,

C:\

silence
Maniac (V) Inmate

From: The South Pacific
Insane since: Jan 2001

posted posted 11-25-2007 13:08

I usually install all the devel and build packages on any linux system. It adds a bit of bloat, but having the required dependencies for anything is worth it.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu