Page 1 of 2

Off to a bad start

PostPosted: Fri Feb 08, 2008 2:15 am
by cobrazuki
Win XP Pro SP2

I have E:\Cobra-0.7.1 and

Code: Select all
class Hello

    def main is shared
        print 'Hello, world.'


as hello.cobra in E:\Cobra-0.7.1\bin

I also have C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

But:

================================================
E:\Cobra-0.7.1\bin>cobra hello.cobra

Looked for C# compiler at:
\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc
\WINNT\Microsoft.NET\Framework\v2.0.50727\csc
/usr/bin/gmcs
/bin/gmcs
/usr/local/bin/gmcs
But cannot find a C# compiler from Microsoft .NET or Novell Mono.
An unhandled exception has occurred.

Cobra debugging tips:
To get file name and line number information for the stack frames, use:
cobra -debug foo.cobra
To get a post-mortem, HTML-formatted report with more details about your objects:
cobra -debug -exception-report foo.cobra
For even more information, try:
cobra -debug -exception-report -detailed-stack-trace foo.cobra
Or use the abbreviations:
cobra -d -er -dst foo.cobra


Unhandled Exception: System.InvalidOperationException: Cannot start process because a file name has
not been provided.
at System.Diagnostics.Process.Start()
at CommandLine.DoRun(List`1 paths)
at CommandLine.Run(List`1 args)
at CommandLine.Run()
at CobraMain.Main()
==================================================================

What's my next step? Get the C# compiler? If so, I need specific directions on where to get it and how and where to install it.

Thanks

Re: Off to a bad start

PostPosted: Fri Feb 08, 2008 5:29 am
by RichS
cobrazuki,

I don't know if this will help, but I had a similar experience.

I've installed my cobra in C:\program files\cobra-0.7.1

If I try to compile a file when I'm on my D: drive I get an error message similar to yours, however, if I go to the C: drive and use the full path to the file on the D: drive, it works.

Rich

Re: Off to a bad start

PostPosted: Fri Feb 08, 2008 6:36 am
by cobrazuki
Hm. As I said I put hello.cobra in E:\Cobra-0.7.1\bin, in the same folder as cobra.exe.

So I'm not sure your case is relevant to mine. But maybe I've misunderstood you?

Thanks

Re: Off to a bad start

PostPosted: Fri Feb 08, 2008 7:35 am
by RichS
What happens if you do this:

Code: Select all
e:> c:

c:> E:\Cobra-0.7.1\bin\cobra -c E:\Cobra-0.7.1\bin\hello.cobra


I know it doesn't make sense, but it works for me.

Re: Off to a bad start

PostPosted: Fri Feb 08, 2008 7:46 am
by cobrazuki
Well, I'll be darned.

C:\>E:\Cobra-0.7.1\bin\cobra -c E:\Cobra-0.7.1\bin\hello.cobra
Compilation succeeded

And then:

E:\Cobra-0.7.1\bin>hello.exe
Hello, world.

Thanks, Rich!

Re: Off to a bad start

PostPosted: Fri Feb 08, 2008 11:32 am
by Charles
Cobra uses C# for a backend instead of IL for various benefits. It has some "well known" paths for locating the C# compiler but these are currently "driveless". I'll be able to fix this pretty easily for the next release.

Sorry for the inconvenience.

Re: Off to a bad start

PostPosted: Sat Feb 09, 2008 5:09 am
by Charles
I have this fixed as well as a problem that international users might experience. Also, multiple int types (int8, ..., int64, uint8, ..., uint64). But I'm too tired now to cut a release, so it's off to bed.

Any other bug reports? I'll check this forum when I get up.

Re: Off to a bad start

PostPosted: Sat Feb 09, 2008 6:05 pm
by Charles
All fixed now. Let me know if you have further problems.

http://cobra-language.com/forums/viewtopic.php?f=4&t=23

Re: Off to a bad start

PostPosted: Mon Mar 03, 2008 9:09 am
by johannes
I have installed my C# compiler on drive H: so cobra still can't find it. It would be cool, if you could tell cobra which compiler to use with an comandline parameter or something like that...

Re: Off to a bad start

PostPosted: Mon Mar 03, 2008 9:36 am
by Charles
Sorry about that. I meant to use .getLogicalDrives when searching but didn't get to it in time for the last release. A command line option would be nice too.

There's also a C# code provider as someone brought up earlier. Maybe that person would like to patch the source (http://cobra-language.com/source/).