#69412 - justatest - Mon Jan 30, 2006 5:50 pm
Hey,
I'm making the transition from C to C++, and am having problems compiling. Loads of syntax errors :-(
Here's a class:
A Makefile:
Compilation errors:
What the hell am I doing wrong? Do I need extra command line paremeters?
I'm making the transition from C to C++, and am having problems compiling. Loads of syntax errors :-(
Here's a class:
Code: |
class MyClassName {
private: int an_integer; int another_var; public: void FunctionOne(void) { an_integer++; } } |
A Makefile:
Code: |
@echo off
set CFILES= main.c set OFILES= main.o set GAME= main set SPECS=gba_mb.specs set DEVDIR=C:\Devkitarm PATH=%DEVDIR%\bin;%path% set LIBDIR= %DEVDIR%\arm-elf\lib\interwork set LIBDIR2= %DEVDIR%\libgba\lib set INCDIR= %DEVDIR%\arm-elf\include set INCDIR2= ..\..\include set CFLAGS= -I. -I%INCDIR% -I%INCDIR2% -c -g -O2 -Wall -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork set LDFLAGS= -mthumb -mthumb-interwork -specs=%SPECS% -L%LIBDIR% -L%LIBDIR2% arm-elf-gcc %CFILES% %CFLAGS% arm-elf-gcc -o %GAME%.elf %OFILES% %LDFLAGS% arm-elf-objcopy -v -O binary %game%.elf %game%.gba gbafix %game%.gba del %OFILES% del %game%.elf ..\..\emulators\VisualBoyAdvance.exe %game%.gba |
Compilation errors:
Code: |
In file included from main.c:32:
class_mario.cpp(1): error: parse error before "MyClassName" class_mario.cpp(1): error: syntax error before '{' token class_mario.cpp(18): error: parse error before ':' token etc etc.. |
What the hell am I doing wrong? Do I need extra command line paremeters?