Subject: problems compiling c++ source
To: None <netbsd-help@netbsd.org>
From: Ethan Bakshy <ethan@enteract.com>
List: netbsd-help
Date: 09/04/1999 21:25:37
I am trying to compile a small C++ program to test the AP Vector class (used for the Advanced Placement C++ course in highschools), but I get this error:
ethan@funbox:/home/ethan/school/cs/09.03.99(48)% g++ main.cc
In file included from main.cc:5:
apvector.h:36: syntax error before `('
apvector.h:48: syntax error before `const'
In file included from apvector.cc:15,
from apvector.h:134,
from main.cc:5:
/usr/include/assert.h:63: syntax error before string constant
why is it having problems with the assert.h file? Is there something I'm not doing right at the command line? .cc is the extension for c++ files, right?
If you guys want to check out the AP Vector class, here's the URI where you can grab it:
http://www.collegeboard.org/index_this/ap/computer-science/html/classes.html
you'll want to go ahead and save the apvector.h and apvector.cpp... the reason you see the .cc extension on those is because i went ahead and renamed the .cpp extension both in the header source and the actual file name.
If it helps, here's my version of NetBSD (uname -a):
NetBSD netbsd 1.4 NetBSD 1.4 (GENERIC) #0: Sun May 9 03:00:22 MEST 1999 pk@
flambard:/usr/src/sys/arch/sparc/compile/GENERIC sparc
I'm pretty new to development under unix-like systems, so be easy on me :) I've been using netbsd/freebsd/linux for a while now, but I haven't been using it for programming- we use M$ Visual C++ at school, so I've been sticking to that.
--
-----ethan.bakshy---------
ethan@enteract.com
http://ethan.home.dhs.org
--------------------------