Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using command line to compile.

Status
Not open for further replies.

cory1

Programmer
Feb 24, 2003
7
US
I am having trouble compiling a program from the command line. I usually don't use the command line, but I would like to familiarize myself with it a little. I am trying to compile the file named "CppTextReader.cpp" and I am trying to pass the file "volcanoes.xml" to the program. I tried doing this like so -> 'cl CppTextReader.cpp volcanoes.xml' What am I doing wrong. It keeps giving me the error 'cl : Command line warning D4024 : unrecognized source file type 'volcanoes.xml', object file assumed


#include "stdafx.h"

#using <mscorlib.dll>
#include <tchar.h>
#using <System.xml.dll>

using namespace System;
using namespace System::Xml;

// This is the entry point for this application
int _tmain(int argc, char* argv[])
{
// Check for required arguments
if (argc < 2)
{
Console::WriteLine(S&quot;Usage: CppTextReader path&quot;);
return -1;
}

String* path = new String(argv[1]);

try
{
// Create the reader...
XmlTextReader* rdr = new XmlTextReader(path);
}
catch(Exception* pe)
{
Console::WriteLine(pe->ToString());
}
return 0;
}
 
Hi,

First you must compile it, &quot;cl cpptextreader.cpp <enter>&quot;
If compiling was successfull, you can run it as much as you want, &quot;cpptextreader volcanoes.xml <enter>&quot;

Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top