fixes to common problems

Find out how to get that @*&^$&@ thing to compile!

fixes to common problems

Postby apex » Sun Aug 05, 2001 6:15 pm

<OL TYPE=1>
[*]Error: Undefined Macro argument list;
Fix: Add -no-cpp-precomp to CFLAGS in Makefile.

[*]Error: configure: error: can not guess host type; you must specify one
Fix: Replace config.sub and config.guess with the ones from /usr/libexec and then remove config.cache.
[/LIST]

[ August 06, 2001: Message edited by: apex ]
apex
 
Posts: 355
Joined: Sun Aug 05, 2001 7:00 pm

Re: fixes to common problems

Postby jasont » Tue Aug 14, 2001 12:49 pm

Error 3: gcc called cross compiler without reference. Use --build=powerpc-apple-bsd or whatever you want instead of --host=...

Error 4: My unix applications keep crashing? Why??? Set the Compiler flags w/ env or using bash to utilize the functions required in the readme. This is ESPECIALLY important for mysql since the version of gcc (called cc) in mac os x supports felide constructors.
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby jasont » Tue Aug 14, 2001 1:11 pm

Error 5: During Make my compiler stopped after ranlib with a message about symbols. Compilers usually cache their build (the .h files become .o files and the compiler continues from the last point when you run make again.) Sometimes (and for no reason I can figure out) the Make file will try to ranlib a lib and then drop out. To remedy this ranlib <filename> and then type make again (this won't always work, but it does a lot of the time).
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby jasont » Thu Aug 16, 2001 12:41 am

6.
Error: gcc doesn't work from the command line.
Reason: Apple has gcc installed as cc
Solution: Make symbolic links for gcc to and g++ to the standard locations
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>
Make sure you have the directories:
/usr/local/bin
Check with ls /usr/local and ls /usr/local/bin
If not you want to create them with:
mkdir /usr/local
mkdir /usr/local/bin

Make symbolic links
ln -s /usr/bin/cc /usr/bin/gcc
ln -s /usr/bin/c++ /usr/bin/g++
ln -s /usr/bin/cc /usr/local/bin/gcc
ln -s /usr/bin/c++ /usr/local/bin/g++

*you may want to do this as root*
</pre>[/quote]
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby apex » Thu Aug 16, 2001 2:00 am

7.

[*]Error: Command not found: make [6]

Fix: Install Apple's Developer Tools
Note: you can upgrade to the latest Dev Tools version from <A HREF="http://connect.apple.com" TARGET=_blank>connect.apple.com</A>

[ August 16, 2001: Message edited by: apex ]
apex
 
Posts: 355
Joined: Sun Aug 05, 2001 7:00 pm

Re: fixes to common problems

Postby jasont » Thu Aug 16, 2001 12:03 pm

8
<UL TYPE=SQUARE>[*]Error: ./configure with every path you can think of specified keeps asking for a library or header file inside of a directory. This frequently occurs when including build directories.
[*]Solution: inside your build directory create a lib and an include directory. Placing libs in the lib one and all header files inside the include one. I recommend copying the files in there, but you may achieve success if you symbolically link them or move them in there.
[/LIST]
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby apex » Thu Aug 16, 2001 2:47 pm

9.

[*]Error: Your compile stops because it cannot find the header file malloc.h

Fix: <BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>touch malloc.h</pre>[/quote]

Apple has included this functionality elsewhere so we create a dummy file to satisfy the programs dependencies. Alternatively you can edit the source and remove the statement: <BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>#include <malloc.h></pre>[/quote]

[ August 16, 2001: Message edited by: apex ]
apex
 
Posts: 355
Joined: Sun Aug 05, 2001 7:00 pm

Re: fixes to common problems

Postby jasont » Thu Aug 16, 2001 3:19 pm

Optionally you can grab it from any of these locations:

/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/malloc.h

/usr/include/objc/malloc.h

/usr/include/sys/malloc.h
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby jasont » Sun Aug 19, 2001 1:30 pm

10
<UL TYPE=SQUARE>[*]Error:
I told configure where a file/lib/binary/header was, put lib and include dirs in my build tree and I still get something like:
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>
checking for <option/file>.....no
</pre>[/quote]

[*]Fix:
Some configuration scripts wander down an application specific source tree when you specify an option. For example, if you specify --something=/usr/local/include the configure script may look for /usr/local/include/somedir/another/something or ever worse /usr/local/include/local/include/somedir/another/something.

To fix this you need to either know exactly what configure is looking for or edit the file. Fortunately configuration scripts are USUALLY layed out in blocks where the screen message almost directly precedes the test. So if your option was --with-sysctl then your best bet is to search for sysctl, look beneath is and see the structure it's looking for, then either edit it, feed it the right arguments, or alter the requested files location.
[/LIST]
-j
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby jasont » Mon Aug 20, 2001 7:08 am

11: Build Location
<UL TYPE=SQUARE>[*]Error: Configure check complains about build directory location. You won't come across this often, but if you do the fix is simple

[*]Fix: As root unpack the archive you are building in /
[/LIST]
-j3
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby jasont » Wed Sep 05, 2001 3:12 pm

12: 'uint32_t' undeclared
<UL TYPE=SQUARE>[*]Error: Item is declared differently on platform[*]Fix: replace uint32_t with u_int32_t (this is qnd)[/LIST]
jasont
 
Posts: 50
Joined: Tue Aug 14, 2001 7:00 pm
Location: Palo Alto, CA

Re: fixes to common problems

Postby apex » Fri Oct 12, 2001 4:26 am

13: Undefined Symbols:
_strtok_r

Fix:
Try replacing all occurances of strok_r() with strtok(). You will need to remove the last argument from strtok_r() when you change it.
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>
grep -r strtok_r src/
</pre>[/quote]
sample:
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>
token = strtok_r(NULL, " ", &blah);
</pre>[/quote]
becomes
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>
token = strtok(NULL, " ");
</pre>[/quote]

14: definition of sys_errlist
Edit the code around line 265 of /usr/include/stdio.h so that it looks like this:
<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, sans-serif">code:</font><HR><pre>
#ifdef mygnudarwindef
extern __const char *__const sys_errlist[];
#endif
</pre>[/quote]
A similar switch can be installed for the bzero definition, if that gives you problems. When you want it to go back to the normal definition, change the ifdef to ifndef.

14: pthread
You may get errors that say you do not have threading on your system.
Edit your Makefiles and remove the "-lpthread" flag from them.
Darwin has threading capability built-into the OS, it doesn't use an external library.

[ October 11, 2001: Message edited by: apex ]
apex
 
Posts: 355
Joined: Sun Aug 05, 2001 7:00 pm


Return to Compile Problems

Who is online

Users browsing this forum: No registered users and 11 guests

cron