Page 1 of 1

problem using dll with namespace compiled with cobra

PostPosted: Sun Dec 07, 2008 5:52 pm
by gauthier
How to reproduce:

file: somenamespace.cobra
namespace SomeNamespace
class SomeType
pass


compile with
Code: Select all
cobra -ert:yes -t:lib somenamespace.cobra


file: test.cobra
use SomeNamespace

class Program
def main is shared
t = SomeType()


compile with
Code: Select all
cobra -ert:yes test.cobra


I get verbose internal error (attached:
log.zip
error log
(5.01 KiB) Downloaded 450 times
)

Re: problem using dll with namespace compiled with cobra

PostPosted: Sun Dec 07, 2008 6:02 pm
by Charles
We have a ticket for this already: http://cobra-language.com/trac/cobra/ticket/3

Are you able to work around this by leaving the -ert:yes off of the library build?

Another workaround would be to leave -ert:no and later use ILMerge to combine everything when it comes time to deliver your application.

Re: problem using dll with namespace compiled with cobra

PostPosted: Sun Dec 07, 2008 6:14 pm
by gauthier
Thanks, the work-around is working :)

I just need to keep Cobra.Lang.dll arround my binaries

Re: problem using dll with namespace compiled with cobra

PostPosted: Sun Dec 07, 2008 6:18 pm
by Charles
If you're using Cobra out of the source code repository, you shouldn't need to. The "install-from-workspace" script installs Cobra.Lang into the GAC where it can be found automatically. See http://cobra-language.com/trac/cobra/wiki/HowToInstallFromSource.

If you're using the latest Cobra and not able to build your project without copying the Cobra.Lang.dll to your directory, please let me know.

Re: problem using dll with namespace compiled with cobra

PostPosted: Mon Dec 08, 2008 12:36 am
by gauthier
Well, the fact that the install script do so in a fixed location was the reason I did not use it.

So I'll register the dll to the gac manually

Re: problem using dll with namespace compiled with cobra

PostPosted: Mon Dec 08, 2008 12:41 am
by Charles
I'll accept a patch that prompts the user for the location. :-)

Something like:
Install to directory [C:\Cobra\Cobra-0.8.1-post]: _