[Mono-dev] Embedding C

Paolo Molaro lupus at ximian.com
Thu Mar 23 10:14:40 EST 2006


On 03/22/06 Rusmin Susanto wrote:
> Thank you everyone for the answers. It worked after I set
> LD_LIBRARY_PATH to the correct location. By the way, where can I get the
> list of all environmet variables that must be set to get Mono works 100%?

Mono doesn't require any environment variables to be set to work 100%.
You simply had your system misconfigured, so don't place the blame on
mono.

> I also had a look at System.String (both String.cs and string-icalls.c). One function that I think makes an internal call is this:
>   private extern String InternalReplace (char oldChar, char newChar); 
>   I looked at string-icalls.c and believed that function 
>   MonoString * ves_icall_System_String_InternalReplace_Char (MonoString *me, gunichar2 oldChar, gunichar2 newChar)
>    implements the System.String.InternalReplace function.
>   To prove this, then I added the following line inside the ves_icall_System_String_InternalReplace_Char function:
>   printf("Internal call ReplaceChar is executed\n");
>   Then, I rebuilt my Mono and install it (all libraries are in the correct place and up to date). 
>   The problem is when I execute the System.String.InternalReplace from a simple C# program, I still didn't see the 
>   "Internal call ReplaceChar is executed"
>   message printed on the screen. Can you tell me what's wrong?

There can be many reasons, I'll list just a few:
*) you didn't actually insert the printf.
*) you inserted the printf in a C comment
*) you didn't save the file after changing it
*) you didn't recompile libmono (after saving the file with the correct change)
*) you didn't install the new libmono
*) you installed in a different directory
*) the aliens came and stole the printf

I'll let you guess which one is the more probable:)
lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list