Q: I obtained the Free Software Foundations libraries described in ../Objective_C/C++_libraries.rtf, but they won't compile. What do I have to do to get them to compile?
A: There are a couple of things that you must do in order to compile version 1.37.0 of libg++ on NEXTSTEP.
| First, you must turn off the inclusion of libg++'s malloc routines. You can do this by setting a compiler flag. Edit the Makefile and search for MALLOC. Remove the comment # indicator on the line which sets XTRAFLAGS to -DNO_LIBGXX_MALLOC. It looks like this when you've finished: |
# Use this to disable placing libg++ version of malloc in libg++.a
XTRAFLAGS = -DNO_LIBGXX_MALLOC
You should also make this change in the Makefile in the tests directory.
| Also, if you are not using gnu make, you should change this line in the same Makefile: |
#PWD := $(shell pwd)
| to point to the directory in which the sources live. |
| Next, you must modify the time.h file. There are some conflicts with the time.h file which is shipped with libg++ and the time.h that comes with the NeXT system. Change the first few lines to look like this: |
#ifndef time_h
#define time_h 1
#ifdef NeXT
#define _TIME_H 1
#endif
| Modify the Makefile in the src and the tests directory. Set GXX to cc++ and set VERBOSITY_FLAGS to -Wall (remove the -v flag. Changing verbosity isn't necessary, but with -v set you will get lots of useless messages. | |
| Like this: GXX = cc++ VERBOSITY_FLAGS = -Wall |
After doing each of these, the GNU libraries compile on NEXTSTEP.
See also: ../Objective_C/C++_libraries.rtf.
QA702
Valid for 2.0, 3.0