Because if he can't be arsed to copy/paste the compile error, I can't be arsed to go try to compile it myself.
Instead of talking, why don't you just tell him the three characters he needs to add to fix it at this point?
You'll probably also want to have the flags-handling loop start at 3 instead of 0 (0 is the program name, 1 is the input file, and 2 is the output file), and you'll need to do something about the input file and output file.Code:switch (argv[nArg][COLOR=red][0][/COLOR]) { case 'r': //the RUN flag run = 1; break; case 'c': //the COMPILE flag compile = 1; break; case 'd': //the debug flag debug = 1; break; default: cout << "ERROR: UNKNOWN ARGUMENT. TERMINATING" << endl; //this is going to pop up an error when an unidetified flag is set return 0; break; }
that would complicate things, as the output file is optional. but, I can work around it, like completely removing the output file argument. the compiler would just name the file according to the input file. E.G. Intel.ZASM would compile to Intel.BIN
also, I should probably mention that the programming reference I have is almost as old as me.... time for a trip to the bookstore.
OH yes, nearly forgot:
Code:
Build started 29/08/2010 11:34:12 AM.
1>Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" on node 2 (build target(s)).
1>PrepareForBuild:
Creating directory "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\Release\".
InitializeBuildStatus:
Creating "Release\compile.unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt EMU.cpp main.cpp OPCODE.cpp
EMU.cpp
main.cpp
1>main.cpp(19): error C2061: syntax error : identifier 'argv'
1>main.cpp(20): error C2143: syntax error : missing ';' before '{'
1>main.cpp(21): error C2046: illegal case
1>main.cpp(22): error C2065: 'run' : undeclared identifier
1>main.cpp(24): error C2046: illegal case
1>main.cpp(25): error C2065: 'compile' : undeclared identifier
1>main.cpp(27): error C2046: illegal case
1>main.cpp(28): error C2065: 'debug' : undeclared identifier
1>main.cpp(30): error C2047: illegal default
OPCODE.cpp
1>Done Building Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" (build target(s)) -- FAILED.
Build FAILED.
Time Elapsed 00:00:01.47
oh, and my brother is a troll. he was the one who told me that I didn't need to link main.h and main.cpp
---------- Post added at 10:41 AM ---------- Previous post was at 10:30 AM ----------
ok, I linked the .H fiel and the .CPP file, and now there appears to be a new problem: it's complaining about the CASE commands, claiming their not constants.
new log:
Code:
Build started 30/08/2010 10:39:50 AM.
1>Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" on node 2 (build target(s)).
1>InitializeBuildStatus:
Touching "Release\compile.unsuccessfulbuild".
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
main.cpp
1>main.cpp(21): error C2051: case expression not constant
1>main.cpp(24): error C2051: case expression not constant
1>main.cpp(27): error C2051: case expression not constant
1>main.cpp(34): warning C4065: switch statement contains 'default' but no 'case' labels
1>Done Building Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" (build target(s)) -- FAILED.
Build FAILED.
Time Elapsed 00:00:00.46
I've modified the .cpp file as helior reccomended.
Last edited: