From 2a3de2593da93042ce4ea2725909a92967962b79 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Thu, 9 Mar 2006 19:06:53 +0000 Subject: fix for strange open_via_path behavior svn path=/trunk/externals/clr/; revision=4675 --- Counter/README.txt | 5 ++++- PureData/README.txt | 11 +++++++++-- clr.cpp | 5 +++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Counter/README.txt b/Counter/README.txt index dd2d745..abd1e59 100755 --- a/Counter/README.txt +++ b/Counter/README.txt @@ -1,3 +1,6 @@ to compile External.dll put PureData.dll in this folder then execute this command: -mcs External.cs Counter.cs -out:External.dll -target:library -r:PureData.dll \ No newline at end of file +Using the Mono C#: +mcs -out:Counter.dll -target:library -r:PureData.dll -optimize+ *.cs + +For the Microsoft C# compiler, use csc instead of mcs diff --git a/PureData/README.txt b/PureData/README.txt index 323f00c..effae75 100755 --- a/PureData/README.txt +++ b/PureData/README.txt @@ -1,3 +1,10 @@ to compile PureData.dll execute this command: - -mcs Atom.cs pd.cs -out:PureData.dll -target:library \ No newline at end of file + +Using the Mono C#: +mcs -unsafe+ -out:PureData.dll -target:library -optimize+ *.cs + +For the Microsoft C# compiler, use csc instead of mcs + + +put the PureData.dll anywhere in the PD search path (like e.g. the extra folder) + diff --git a/clr.cpp b/clr.cpp index e7c9291..201300b 100755 --- a/clr.cpp +++ b/clr.cpp @@ -909,7 +909,8 @@ void clr_setup(void) // search in the PD path int fd; if ((fd = open_via_path("",CORELIB,"." DLLEXT,dirbuf,&nameptr,MAXPDSTRING,1)) >= 0) { - strcat(dirbuf,"/" CORELIB "." DLLEXT); + if(dirbuf != nameptr) // fix for the fact that open_via_path doesn't return a path, when it's found in . + strcat(dirbuf,"/" CORELIB "." DLLEXT); close(fd); } else @@ -918,7 +919,7 @@ void clr_setup(void) // look for PureData.dll MonoAssembly *assembly = mono_domain_assembly_open (monodomain,dirbuf); if(!assembly) { - error("clr: assembly " CORELIB "." DLLEXT " not found!"); + error("CLR - assembly %s not found!",dirbuf); return; } -- cgit v1.2.1