Forums

Off to a bad start

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Off to a bad start

Postby cobrazuki » Fri Feb 08, 2008 2:15 am

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
cobrazuki
 
Posts: 5

Re: Off to a bad start

Postby RichS » Fri Feb 08, 2008 5:29 am

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
RichS
 
Posts: 8

Re: Off to a bad start

Postby cobrazuki » Fri Feb 08, 2008 6:36 am

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
cobrazuki
 
Posts: 5

Re: Off to a bad start

Postby RichS » Fri Feb 08, 2008 7:35 am

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.
RichS
 
Posts: 8

Re: Off to a bad start

Postby cobrazuki » Fri Feb 08, 2008 7:46 am

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!
cobrazuki
 
Posts: 5

Re: Off to a bad start

Postby Charles » Fri Feb 08, 2008 11:32 am

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.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Off to a bad start

Postby Charles » Sat Feb 09, 2008 5:09 am

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.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Off to a bad start

Postby Charles » Sat Feb 09, 2008 6:05 pm

All fixed now. Let me know if you have further problems.

http://cobra-language.com/forums/viewtopic.php?f=4&t=23
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Off to a bad start

Postby johannes » Mon Mar 03, 2008 9:09 am

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...
johannes
 
Posts: 8

Re: Off to a bad start

Postby Charles » Mon Mar 03, 2008 9:36 am

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/).
Charles
 
Posts: 2515
Location: Los Angeles, CA

Next

Return to Discussion

Who is online

Users browsing this forum: No registered users and 20 guests

cron