.net compiler

General questions about using TextPad

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

zoerb
Posts: 1
Joined: Fri Jun 04, 2004 2:34 am

.net compiler

Post by zoerb »

how do i use the .net compiler from the free Microsoft Visual C++ Toolkit 2003 in textpad?
User avatar
TheSquirrelKing
Posts: 3
Joined: Mon Oct 04, 2004 8:24 pm
Location: Canada, eh!

Post by TheSquirrelKing »

Anyone know how to get these two to play nicely together and actually compile some c++?
User avatar
Drxenos
Posts: 210
Joined: Mon Jul 07, 2003 8:38 pm

Post by Drxenos »

The same way you would any compiler. Just create a tool for it.
User avatar
TheSquirrelKing
Posts: 3
Joined: Mon Oct 04, 2004 8:24 pm
Location: Canada, eh!

Post by TheSquirrelKing »

The rather obvious aside, I was asking (or maybe just trying to) if anyone already had the specific set of settings, flags, and all that good stuff already configured in a way that has worked well for them. It's all good though, I managed to crank out a configuration that seems to be working properly so far. In a pinch I can fall back on Visual Studio, but interestingly enough I prefer TextPad for a number of reasons. How's that for praise?
bveldkamp

Post by bveldkamp »

Care to enlighten us? All I get is "Tool completed with exit code 128"
User avatar
TheSquirrelKing
Posts: 3
Joined: Mon Oct 04, 2004 8:24 pm
Location: Canada, eh!

Post by TheSquirrelKing »

hmm, I no longer have the tool setup on my system (did a Windows re-install...) but I googled the issue and was able to find this page that may help you: http://guinness.cs.stevens-tech.edu/~as ... r_VCpp.htm
bveldkamp

Post by bveldkamp »

Thanks, I missed some paths.

Instead of changing the PATH variable, I use a batch file, so I can change it if needed, without restarting Textpad.

cl.bat:

Code: Select all

@echo off
set PATH=%PATH%;D:\Program\Microsoft Visual Studio .NET 2003\Common7\IDE
set LIB=D:\Program\Microsoft Visual Studio .NET 2003\Vc7\lib;D:\Program\Microsoft.NET\SDK\v1.1\Lib
@echo on
"D:\Program\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
User avatar
webmasta
Posts: 169
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

Its a darn good tut on how to configure TP, but I simply cant get it to work the way it should, I keep getting the errors below and all the paths etc are correct - although the same program compiles and runs ok from the command prompt.. :?

Closing TP and reopening with the .cpp file loaded will sometimes compile without errors but no .exe file is created... :o

Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

cl : Command line warning D4024 : unrecognized source file type 'Files\Microsoft', object file assumed
cl : Command line warning D4027 : source file 'Files\Microsoft' ignored
cl : Command line warning D4024 : unrecognized source file type 'Visual', object file assumed
cl : Command line warning D4027 : source file 'Visual' ignored
cl : Command line warning D4024 : unrecognized source file type 'Studio', object file assumed
cl : Command line warning D4027 : source file 'Studio' ignored
cl : Command line warning D4024 : unrecognized source file type '.NET', object file assumed
cl : Command line warning D4027 : source file '.NET' ignored
cl : Command line warning D4024 : unrecognized source file type '2003\Vc7\include"', object file assumed
cl : Command line warning D4027 : source file '2003\Vc7\include"' ignored
textPadCompile1.cpp
G:\textPadCompile1.cpp(4) : error C2873: 'System' : symbol cannot be used in a using-declaration
G:\textPadCompile1.cpp(6) : error C3381: 'DebugTwo1' : an assembly access specifier can only be applied to a managed type
G:\textPadCompile1.cpp(8) : error C2144: syntax error : 'void' should be preceded by ':'
G:\textPadCompile1.cpp(23) : fatal error C1004: unexpected end of file found

Tool completed with exit code 2
bveldkamp

Post by bveldkamp »

It looks like you need to put quotes around the include path, since it contains spaces, i.e.

Code: Select all

"c:\Program Files\Microsoft Visual Studio .Net 2003\Vc7\include"
or use the old dos 8.3 notation:

Code: Select all

c:\progra~1\micros~1.net\vc7\include
(you can check the numbers from a command prompt with dir /x)
User avatar
webmasta
Posts: 169
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

Ya .. paths are quoted in the parameters field:

-I�C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include� -EHsc -c $File

-LIBPATH:�C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib� -LIBPATH:�C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\lib� $BaseName.obj

Dunno what else could be the issue and google dont seem to have answers on this one.

/Pete.
bveldkamp

Post by bveldkamp »

Do you have exactly that type of quote, or is that just a copy/paste issue? Because it should be " not �
User avatar
webmasta
Posts: 169
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

Good one!

That quote must have come from when I copied the path from the tut as it was exactly the same path as mine... now it executes without error but still not compiling .. strange, it compiles from cmd.


Microsoft (R) 32-bit C/C++ Standard Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

TextpadCompile1.cpp
G:\TextpadCompile1.cpp(12) : error C2873: 'System' : symbol cannot be used in a using-declaration
G:\TextpadCompile1.cpp(14) : error C3381: 'CompareNames' : an assembly access specifier can only be applied to a managed type
G:\TextpadCompile1.cpp(15) : error C2144: syntax error : 'void' should be preceded by ':'
G:\TextpadCompile1.cpp(26) : fatal error C1004: unexpected end of file found

Tool completed with exit code 2
bveldkamp

Post by bveldkamp »

I'm not exactly an expert, I just managed to compile HelloWorld.cpp but I had to use parameters /clr instead of -EHsc -c
User avatar
webmasta
Posts: 169
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

hmmm... heres my hello world
public class FirstClass
{
public static void Main()
{
System.Console.WriteLine("Hello World");
}
}
And heres my results:
Microsoft (R) C/C++ Standard Compiler Version 13.10.3077 for .NET Framework
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

hello.cpp
C:\Documents and Settings\Webmasta\My Documents\hello.cpp(2) : error C3381: 'FirstClass' : an assembly access specifier can only be applied to a managed type
C:\Documents and Settings\Webmasta\My Documents\hello.cpp(3) : error C2144: syntax error : 'void' should be preceded by ':'
C:\Documents and Settings\Webmasta\My Documents\hello.cpp(8) : fatal error C1004: unexpected end of file found

Tool completed with exit code 2
Wierd/ Pete.
bveldkamp

Post by bveldkamp »

Shouldn't there be a void main() in there somewhere (again, I'm just starting myself)?
Here's what I copied from an example:

Code: Select all

#using <mscorlib.dll>

using namespace System;

void main() {
   Console::WriteLine(S"Hello World");
}
Post Reply