[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-osx
Subject:    Re: [Mono-osx] Issue with DLL - How to make use of DLL
From:       "Viet Le" <viet.aikidorb () gmail ! com>
Date:       2008-10-19 0:42:37
Message-ID: c13c1ffe0810181742y381cbda6o487b3d76fcdeecb () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thank you very much for quick reply.

Best regards,
Viet.

On Sun, Oct 19, 2008 at 8:37 AM, Geoff Norton <gnorton@novell.com> wrote:

> If you store it relative to the exe mono will find it automatically.
>
> -g
>
> On Sun, 2008-10-19 at 08:21 +0800, Viet Le wrote:
> > Hi Geoff,
> >
> > Thank you for the reply. May I know where to store the newly
> > compiled .dylib file to pinvoke?
> >
> > Best regards,
> > Viet.
> >
> > On Sun, Oct 19, 2008 at 5:40 AM, Geoff Norton <gnorton@novell.com>
> > wrote:
> >         You can't, you've compiled a native library.  You need to port
> >         it to Mac
> >         and compile the code there to pinvoke it.
> >
> >         -g
> >
> >
> >         On Sat, 2008-10-18 at 23:34 +0800, Viet Le wrote:
> >         > Hi all,
> >         >
> >         > I compiled C# code on MacOS Tiger using Mono 2.0 and
> >         compiled the
> >         > tidyit.dll using Visual Studio 2005 SP1 on Windows XP SP3.
> >         >
> >         > The part of code that references tidyit.dll is:
> >         >
> >         > namespace Viet.Projects.Google
> >         > {
> >         >         class GoogleClient
> >         >         {
> >         >                 [DllImport("tidyit.dll")]
> >         >                 public static extern string tidyit(string
> >         input, ref
> >         > string out_str, ref string err_str);
> >         >
> >         > I don't know how to force/let compiled .exe file to use
> >         tidyit.dll on
> >         > my Mac:
> >         >
> >         > Unhandled Exception: System.DllNotFoundException: tidyit.dll
> >         >   at (wrapper managed-to-native)
> >         > Viet.Projects.Google.GoogleClient:tidyit
> >         (string,string&,string&)
> >         >   at Viet.Projects.Google.GoogleClient.Main (System.String[]
> >         args)
> >         > [0x00000]
> >         >
> >         > Please kindly advise. Thank you very much!
> >         >
> >         > Best regards,
> >         > Viet.
> >         >
> >         > --
> >         > I submit to you that if a man hasn't discovered something he
> >         will die
> >         > for, he isn't fit to live.
> >         > (Martin Luther King Jr.)
> >         > -----
> >         >
> >
> >         > _______________________________________________
> >         > Mono-osx mailing list
> >         > Mono-osx@lists.ximian.com
> >         > http://lists.ximian.com/mailman/listinfo/mono-osx
> >
> >
> >
> >
> > --
> > I submit to you that if a man hasn't discovered something he will die
> > for, he isn't fit to live.
> > (Martin Luther King Jr.)
> > -----
> >
>
>


-- 
I submit to you that if a man hasn't discovered something he will die for,
he isn't fit to live.
(Martin Luther King Jr.)
-----

[Attachment #5 (text/html)]

<div dir="ltr">Thank you very much for quick reply.<br><br>Best \
regards,<br>Viet.<br><br><div class="gmail_quote">On Sun, Oct 19, 2008 at 8:37 AM, \
Geoff Norton <span dir="ltr">&lt;<a \
href="mailto:gnorton@novell.com">gnorton@novell.com</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">If you store it relative to the exe \
mono will find it automatically.<br> <font color="#888888"><br>
-g<br>
</font><div><div></div><div class="Wj3C7c"><br>
On Sun, 2008-10-19 at 08:21 +0800, Viet Le wrote:<br>
&gt; Hi Geoff,<br>
&gt;<br>
&gt; Thank you for the reply. May I know where to store the newly<br>
&gt; compiled .dylib file to pinvoke?<br>
&gt;<br>
&gt; Best regards,<br>
&gt; Viet.<br>
&gt;<br>
&gt; On Sun, Oct 19, 2008 at 5:40 AM, Geoff Norton &lt;<a \
href="mailto:gnorton@novell.com">gnorton@novell.com</a>&gt;<br> &gt; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; You can&#39;t, you&#39;ve compiled a native library. \
&nbsp;You need to port<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; it to Mac<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; and compile the code there to pinvoke it.<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; -g<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; On Sat, 2008-10-18 at 23:34 +0800, Viet Le \
wrote:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Hi all,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; I compiled C# code on MacOS Tiger using Mono \
2.0 and<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; compiled the<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; tidyit.dll using Visual Studio 2005 SP1 on \
Windows XP SP3.<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; The part of code that references tidyit.dll \
is:<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; namespace Viet.Projects.Google<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; class \
GoogleClient<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; \
{<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; [DllImport(&quot;tidyit.dll&quot;)]<br> &gt; &nbsp; &nbsp; &nbsp; \
&nbsp; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; public static \
extern string tidyit(string<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; input, ref<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; string out_str, ref string err_str);<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; I don&#39;t know how to force/let compiled .exe \
file to use<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; tidyit.dll on<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; my Mac:<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Unhandled Exception: \
System.DllNotFoundException: tidyit.dll<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; \
&nbsp; at (wrapper managed-to-native)<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; \
Viet.Projects.Google.GoogleClient:tidyit<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; \
(string,string&amp;,string&amp;)<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; &nbsp; at \
Viet.Projects.Google.GoogleClient.Main (System.String[]<br> &gt; &nbsp; &nbsp; &nbsp; \
&nbsp; args)<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; [0x00000]<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Please kindly advise. Thank you very much!<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Best regards,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; Viet.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; --<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; I submit to you that if a man hasn&#39;t \
discovered something he<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; will die<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; for, he isn&#39;t fit to live.<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; (Martin Luther King Jr.)<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; -----<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; \
_______________________________________________<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; \
&gt; Mono-osx mailing list<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &gt; <a \
href="mailto:Mono-osx@lists.ximian.com">Mono-osx@lists.ximian.com</a><br> &gt; &nbsp; \
&nbsp; &nbsp; &nbsp; &gt; <a href="http://lists.ximian.com/mailman/listinfo/mono-osx" \
target="_blank">http://lists.ximian.com/mailman/listinfo/mono-osx</a><br> &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; I submit to you that if a man hasn&#39;t discovered something he will die<br>
&gt; for, he isn&#39;t fit to live.<br>
&gt; (Martin Luther King Jr.)<br>
&gt; -----<br>
&gt;<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>I submit to you that if \
a man hasn&#39;t discovered something he will die for, he isn&#39;t fit to \
live.<br>(Martin Luther King Jr.)<br>-----<br> </div>



_______________________________________________
Mono-osx mailing list
Mono-osx@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-osx


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic