I've been trying to compile my first app, and been getting nowhere
with a mysterious error message. I see others have asked, and since
the solution is equally obvious, thought I'd post it.
To find the problem, I copied the minimal sample (to folder 'grot'),
compiled it, then created a couple of tiny .cpp and .h files with a
single dummy function in, and edited minimal.cpp to use them. The
Makefile is below.
On compilation I got:
----Trace---
[localhost:~/wxmac/samples] rpearse% cd grot
[localhost:~/wxmac/samples/grot] rpearse% make clean
slim.o:1: *** missing separator. Stop.
[localhost:~/wxmac/samples/grot] rpearse% make
slim.o:1: *** missing separator. Stop.
[localhost:~/wxmac/samples/grot] rpearse% rm *.o
[localhost:~/wxmac/samples/grot] rpearse% make
c++ -c -I../../lib/wx/include/mac-2.4 -I../../include
-I../../src/png -I../../src/jpeg -I../../src/tiff
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -no-cpp-precomp -fpascal-strings
-I../../src/mac/morefile -I/Developer/Headers/FlatCarbon
-D__WXMAC__ -DWXMAKINGDLL -O2 -MMD -fno-common -Wall -o slim.o
slim.cpp
slim.o:1: *** missing separator. Stop.
[localhost:~/wxmac/samples/grot] rpearse%
-- end trace--
The key is that 'make clean' didn't work: this shows a makefile error.
There is actually nothing wrong with slim.cpp, which contains nothing
much (I took a copy of minimal, created slim.cpp and slim.h with a
dummy function in it, edited the generated Makefile and compiled).
The problem is the Makefile:
---Makefile start--
# Generated automatically from Makefile.in by configure.
#
# File: makefile.unx
# Author: Julian Smart
# Created: 1998
# Updated:
# Copyright: (c) 1998 Julian Smart
#
# "%W% %G%"
#
# Makefile for minimal example (UNIX).
top_srcdir = ../..
top_builddir = ../..
program_dir = samples/minimal
PROGRAM=minimal
OBJECTS =$(PROGRAM).o consts.o slim.o
DEPFILES=$(PROGRAM).d consts.d slim.o
include ../../src/makeprog.env
-include $(DEPFILES)
---end---
This is identical with the minimal one, after samples created, except
that I have added consts.o/d and slim.o/d to it.
The error is caused because of this
DEPFILES=$(PROGRAM).d consts.d slim.o
It should be
DEPFILES=$(PROGRAM).d consts.d slim.d
When I did that, it all worked fine.
Another time I got this:
--start--
[localhost:~/wxmac/samples/string_harness] rpearse% make clean
consts.o:1: warning: NUL character seen; rest of line ignored
consts.o:1: *** missing separator. Stop.
[localhost:~/wxmac/samples/string_harness] rpearse%
--end--
It's caused by the same error, and fixed in the same way.
All the best,
Roger Pearse