Page 1 of 1

Newbie config problem

PostPosted: Fri Oct 18, 2013 3:00 am
by shakeshuck
I installed Cobra (Cobra 0.9.4 on .NET CLR v4.0.30319 on Microsoft Windows NT 6.1.7601) yesterday, along with SciTE and the plugins.

For a quick test, I started looking at the sample progs. I wanted to see how GTK looks on Win 7, so tried that sample. It took me a while to get pkg-config installed and seeing the dlls, but I now get the error: Cannot find namespace "Gtk".

I know this is not a Cobra problem, but I'm new to the whole .NET business; if someone could please point me in the right direction I would appreciate it. I am running 64-bit Windows, and as far as I am aware the dlls are 32-bit? Could this be the problem?

Thanks.

Re: Newbie config problem

PostPosted: Fri Oct 18, 2013 9:31 am
by Charles
Please paste in your compilation line with -v added, and all output.

Re: Newbie config problem

PostPosted: Fri Oct 18, 2013 10:03 am
by shakeshuck
Hi Charles,

Sorry - I hadn't realized there was a -v on the compiler.

Using:

Code: Select all
cobra -v -pkg:gtk-sharp-2.0 SciTE_test.cobra


The output is:

Code: Select all
Cobra Command Line 0.9.4
Copyright (C) 2003-2013 by Cobra Language LLC.

OS Version:   Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Platform: .NET
CLR Version:  4.0.30319.1008
Current Directory: C:\Users\Graham\Documents\CobraProjects
Current Exe: C:\Cobra\Cobra-0.9.4\bin\cobra.exe
Option Dictionary:
    verbosity: 1
    pkg: List<of String>['gtk-sharp-2.0']
    back-end: 'none'
    contracts: 'inline'
    copy-core: false
    correct-source: Set<of String>['none']
    debug: '1'
    debugging-tips: true
    embed-run-time: false
    embed-version: 'compiler-version'
    include-asserts: true
    include-nil-checks: true
    include-tests: true
    include-traces: true
    native-compiler: 'auto'
    number: 'decimal'
    test-runner: 'Cobra.Core.CobraCore.runAppTests'
    testify-results: 'r-testify.text'
Paths:
    SciTE_test.cobra
Phase: Binding Cobra run-time library
Adding reference to Cobra.Core.dll
Phase: Reading libraries
Reading assembly:  mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
              at:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll
Reading assembly:  System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
              at:  C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll
Loading reference: Cobra.Core.dll
Reading assembly:  Cobra.Core, Version=0.9.4.0, Culture=neutral, PublicKeyToken=0a4783a5c7c9616e
              at:  C:\Windows\Microsoft.Net\assembly\GAC_32\Cobra.Core\v4.0_0.9.4.0__0a4783a5c7c9616e\Cobra.Core.dll
Loading reference: C:/Cobra/gtk/lib/gtk-sharp-2.0/pango-sharp.dll
Reading assembly:  pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f
              at:  C:\Windows\Microsoft.Net\assembly\GAC_MSIL\pango-sharp\v4.0_2.12.0.0__35e10195dab3c99f\pango-sharp.dll
Loading reference: C:/Cobra/gtk/lib/gtk-sharp-2.0/glib-sharp.dll
Reading assembly:  glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f
              at:  C:\Windows\Microsoft.Net\assembly\GAC_MSIL\glib-sharp\v4.0_2.12.0.0__35e10195dab3c99f\glib-sharp.dll
Phase: Parsing source code
Setting option "back-end" to default value none.
Setting option "contracts" to default value inline.
Setting option "copy-core" to default value false.
Setting option "correct-source" to default value {'none'}.
Setting option "debug" to default value 1.
Setting option "debugging-tips" to default value true.
Setting option "embed-run-time" to default value false.
Setting option "embed-version" to default value compiler-version.
Setting option "include-asserts" to default value true.
Setting option "include-nil-checks" to default value true.
Setting option "include-tests" to default value true.
Setting option "include-traces" to default value true.
Setting option "native-compiler" to default value auto.
Setting option "number" to default value decimal.
Setting option "test-runner" to default value Cobra.Core.CobraCore.runAppTests.
Setting option "testify-results" to default value r-testify.text.
parseToOptions Option Dictionary:
    pkg: List<of String>['gtk-sharp-2.0']
    back-end: 'none'
    contracts: 'inline'
    copy-core: false
    correct-source: Set<of String>['none']
    debug: '1'
    debugging-tips: true
    embed-run-time: false
    embed-version: 'compiler-version'
    include-asserts: true
    include-nil-checks: true
    include-tests: true
    include-traces: true
    native-compiler: 'auto'
    number: 'decimal'
    test-runner: 'Cobra.Core.CobraCore.runAppTests'
    testify-results: 'r-testify.text'
preAugment Options Dictionary
    verbosity: 1
    pkg: List<of String>['gtk-sharp-2.0']
    back-end: 'none'
    contracts: 'inline'
    copy-core: false
    correct-source: Set<of String>['none']
    debug: '1'
    debugging-tips: true
    embed-run-time: false
    embed-version: 'compiler-version'
    include-asserts: true
    include-nil-checks: true
    include-tests: true
    include-traces: true
    native-compiler: 'auto'
    number: 'decimal'
    test-runner: 'Cobra.Core.CobraCore.runAppTests'
    testify-results: 'r-testify.text'
    reference: List<of String>['Cobra.Core.dll']
pkg "gtk-sharp-2.0" already in options.pkg
post augmentOptions
    verbosity: 1
    pkg: List<of String>['gtk-sharp-2.0']
    back-end: 'none'
    contracts: 'inline'
    copy-core: false
    correct-source: Set<of String>['none']
    debug: '1'
    debugging-tips: true
    embed-run-time: false
    embed-version: 'compiler-version'
    include-asserts: true
    include-nil-checks: true
    include-tests: true
    include-traces: true
    native-compiler: 'auto'
    number: 'decimal'
    test-runner: 'Cobra.Core.CobraCore.runAppTests'
    testify-results: 'r-testify.text'
    reference: List<of String>['Cobra.Core.dll']
Phase: Binding use directives
Loading reference: Gtk.dll
Could not load "Gtk.dll" due to: Could not find file.
Phase: Checking if a default number type should be suggested
SciTE_test.cobra(23): error: Cannot find namespace "Gtk".
Compilation failed - 1 error, 0 warnings
No intermediate files to keep or delete.
Not running due to errors above.


I've just had a look and I don't have a Gtk.dll - I didn't see mention on their site of having to install gtk AND gtk-sharp?

Re: Newbie config problem

PostPosted: Fri Oct 18, 2013 10:08 am
by shakeshuck
It is listed as a dependency, but I have mono running as well (I failed getting Cobra to work in there) and that displays gtk windows from C# (again, I tried a sample). Odd, considering I don't have a gtk.dll?

Re: Newbie config problem

PostPosted: Fri Oct 18, 2013 10:32 pm
by Charles
Are you able to run the sample Gtk# apps listed here?
http://www.mono-project.com/Using_Mono_ ... ows#Gtk.23

Can you get a Gtk# program in C# to compile from the command line as seen here?
http://www.mono-project.com/GtkSharp:_Hello_World

If not, check if you have a Mono prompt that you can bring up which should then have the correct library paths to search for.

Often a problem of the form "cannot do X in Cobra" can be turned into "cannot do X in C#" at which point there is a lot of help via blogs, wikis, stackoverflow, etc. that you can explore.

Re: Newbie config problem

PostPosted: Sat Oct 19, 2013 9:19 am
by shakeshuck
Hi Charles,

The various help locations hadn't been much help - I did try those before coming here.

I did get it working in the end, though. :D

It appears Mono (or at least pkg-config, I think it was) doesn't like spaces in the PATH. Installing to the default "Program Files (x86)" on Windows wasn't a good idea.
...and I thought we'd moved on from the 80's ;)

I did have to install Gtk# separately, too.

And remember to set the compiler for x86, also. Sheesh!

Hopefully I can now make some headway and give this nice language some proper testing!

Thanks.

Re: Newbie config problem

PostPosted: Sat Oct 19, 2013 10:01 am
by Charles
Yeah, I hear you on the spaces. I've had similar problems with pkg-config on Mac. There, I solve them by making a link without spaces.

And the bit width issues feel silly too.