[Mono-dev] mcs compiling error

Sebastien Pouliot sebastien.pouliot at gmail.com
Tue May 29 15:26:08 EDT 2007

On Tue, 2007-05-29 at 21:10 +0200, josepascual wrote:
> Hi,
> mono 1.2.4 (from linux installer)
> -----------------
> mcs InheriHelloWorld.cs -pkg:libgdiplus
> error CS2007: Unrecognized command-line option: `-Wl,--export-dynamic'
> Compilation failed: 1 error(s), 0 warnings
> -----------------
> Why this one?

short answer: because you used -pkg:libgdiplus

long answer: 

libgdiplus is a native (unmanaged) library. mcs -pkg option exists to
help you reference (managed) assemblies. What you probably want is to
use System.Drawing. This can be done in two ways:

(1) -r:System.Drawing.dll

to instruct mcs to reference this managed assembly (which is, mostly, a
wrapper around libgdiplus).

(2) -pkg:dotnet

to instruct mcs to reference all assemblies part of the dotnet package.
This packages includes System.Drawing.dll (and most/all? of the
"standard" assemblies that MS csc refers automatically)

Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/

More information about the Mono-devel-list mailing list