[Mono-dev] Compiling LDAP on mono 1.1.15 on windows

Justin Dearing zippy1981 at gmail.com
Sun Apr 23 08:57:35 EDT 2006


Folks,

First of all I wrote build_mono.bat  based on build.bat with a
modified compile line from muild.sh to get it to build. I ran this
from the "mono command prompt" shortcut that setups a command line
envirorment for mono. Code is below:

=======================================================

@echo off
if not exist lib   md lib
if not exist doc   md doc

if exist lib\Novell.Directory.Ldap.dll del lib\Novell.Directory.Ldap.dll

echo "Building resources..."
call resgen Novell.Directory.Ldap\Novell.Directory.Ldap.UtilClass\ExceptionMessages.txt
lib\ExceptionMessages.resources

call resgen Novell.Directory.Ldap\Novell.Directory.Ldap.UtilClass\ResultCodeMessages.txt
lib\ResultCodeMessages.resources
echo "Generating lib\Novell.Directory.Ldap.dll.."
mcs -debug /noconfig /target:library /r:mscorlib.dll /r:System.dll
-resource:.\lib\ResultCodeMessages.resources
-resource:.\lib\ExceptionMessages.resources
-nowarn:0219,1570,1572,1574,1587 /doc:.\doc\comments.xml
/out:.\lib\Novell.Directory.Ldap.dll
@Novell.Directory.Ldap.dll.sources


del lib\ResultCodeMessages.resources
del lib\ExceptionMessages.resources

=======================================================

I put the call in front of the resgen because it stops after te first
resgen without it. I guess resgen in mono is a batch file wrapper
around something else. I didnt bother to check as it wasn't
particularly important. I replaced all the `pwd` with "." in the path
references. I then replaced the -g with -debug as apprently -g was
depreciated.


I tried compiling Novells LDAP library on windows out of their cvs and
got several Error CS3011. The message text for that error is "only
CLS-compliant members can be abstract"

It seems that if you give an interface an attributre of 
[CLSCompliant(true)] in mono, you have to explicitly do so for each
member. I find it funny that the novell CsharpLdap library needs some
modification to  compile on mono so its possible I;m doing something
else wrong. but apply this patch inside of
"CsharpLDAP/Novell.Directory.LDAP/Novell.Directory.Ldap.Asn1/" to get
it to compile on mono for windows with my batch file.


==================================================================

diff -c /cygdrive/c/src/CsharpLDAP/Novell.Directory.LDAP/Novell.Directory.Ldap.Asn1/Asn1Encoder.cs
./Asn1Encoder.cs
*** /cygdrive/c/src/CsharpLDAP/Novell.Directory.LDAP/Novell.Directory.Ldap.Asn1/Asn1Encoder.cs	Sat
Dec 13 03:58:20 2003
--- ./Asn1Encoder.cs	Sun Apr 23 07:28:39 2006
***************
*** 65,70 ****
--- 65,71 ----
  			/// <param name="out">The output stream onto which the ASN.1 object is

  			/// to be encoded

  			/// </param>

+ 			[CLSCompliantAttribute(true)]

  			void  encode(Asn1Boolean b, System.IO.Stream out_Renamed);

  			

  			/// <summary> Encode an Asn1Numeric directly to a stream.

***************
*** 81,86 ****
--- 82,88 ----
  			/// <param name="out">The output stream onto which the ASN.1 object is

  			/// to be encoded

  			/// </param>

+ 			[CLSCompliantAttribute(true)]

  			void  encode(Asn1Numeric n, System.IO.Stream out_Renamed);

  			

  			/* Asn1 TYPE NOT YET SUPPORTED

***************
*** 98,103 ****
--- 100,106 ----
  			/// <param name="out">The output stream onto which the ASN.1 object is

  			/// to be encoded

  			/// </param>

+ 			[CLSCompliantAttribute(true)]

  			void  encode(Asn1Null n, System.IO.Stream out_Renamed);

  			

  			/* Asn1 TYPE NOT YET SUPPORTED

***************
*** 115,120 ****
--- 118,124 ----
  			/// <param name="out">The output stream onto which the ASN.1 object is

  			/// to be encoded

  			/// </param>

+ 			[CLSCompliantAttribute(true)]

  			void  encode(Asn1OctetString os, System.IO.Stream out_Renamed);

  			

  			/* Asn1 TYPE NOT YET SUPPORTED

***************
*** 141,146 ****
--- 145,151 ----
  			/// <param name="out">The output stream onto which the ASN.1 object is

  			/// to be encoded

  			/// </param>

+ 			[CLSCompliantAttribute(true)]

  			void  encode(Asn1Structured c, System.IO.Stream out_Renamed);

  			

  			/// <summary> Encode an Asn1Tagged directly to a stream.

***************
*** 152,157 ****
--- 157,163 ----
  			/// <param name="out">The output stream onto which the ASN.1 object is

  			/// to be encoded

  			/// </param>

+ 			[CLSCompliantAttribute(true)]

  			void  encode(Asn1Tagged t, System.IO.Stream out_Renamed);

  			

  			/* Encoders for ASN.1 useful types

***************
*** 169,174 ****
--- 175,181 ----
  			/// <param name="out">The output stream onto which the ASN.1 object is

  			/// to be encoded

  			/// </param>

+ 			[CLSCompliantAttribute(true)]

  			void  encode(Asn1Identifier id, System.IO.Stream out_Renamed);

  		}

  }

diff -c /cygdrive/c/src/CsharpLDAP/Novell.Directory.LDAP/Novell.Directory.Ldap.Asn1/Asn1Object.cs
./Asn1Object.cs
*** /cygdrive/c/src/CsharpLDAP/Novell.Directory.LDAP/Novell.Directory.Ldap.Asn1/Asn1Object.cs	Sat
Nov 15 05:01:04 2003
--- ./Asn1Object.cs	Sun Apr 23 07:30:05 2006
***************
*** 60,65 ****
--- 60,66 ----
  		/// <param name="out">The output stream onto which the encoded

  		/// Asn1Object will be placed.

  		/// </param>

+ 		[CLSCompliantAttribute(true)]

  		abstract public void  encode(Asn1Encoder enc, System.IO.Stream out_Renamed);

  		

  		/// <summary> Returns the identifier for this Asn1Object as an
Asn1Identifier.

Common subdirectories:
/cygdrive/c/src/CsharpLDAP/Novell.Directory.LDAP/Novell.Directory.Ldap.Asn1/CVS
and ./CVS
Only in .: Novell.Directory.Ldap.Asn1.patch



More information about the Mono-devel-list mailing list