dbus-sharp icon indicating copy to clipboard operation
dbus-sharp copied to clipboard

Compile error: Protocol/MessageReader.cs(579,25): error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `T'

Open DavidNielsen opened this issue 12 years ago • 3 comments

I've been attempting to compile 0.8.0 on my Mac but it fails with the following output. hub.com/DavidNielsen/bockbuild

2013-11-07 10:36:58: Building dbus-sharp on python-posix (4 CPU) + /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/bin/tar xf /Users/gnomeuser/Documents/Projekter/bockbuild-timo/cache/8eaea9441901d411974e55cde896df33838f3b69 -O > /dev/null + using cached source: /Users/gnomeuser/Documents/Projekter/bockbuild-timo/cache/8eaea9441901d411974e55cde896df33838f3b69 ==> 2013-11-07 10:36:58: Preping dbus-sharp + /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/bin/tar xf /Users/gnomeuser/Documents/Projekter/bockbuild-timo/cache/8eaea9441901d411974e55cde896df33838f3b69 + cd "mono-dbus-sharp-8eaea94" ==> 2013-11-07 10:36:58: Building dbus-sharp + ./autogen.sh --prefix="/Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install" configure.ac:8: installing './install-sh' configure.ac:8: installing './missing' Makefile.am: installing './INSTALL' checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... yes checking for pkg-config... /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for MONO... yes checking for gmcs... /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/bin/gmcs checking for gacutil... /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/bin/gacutil checking for xbuild... /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/bin/xbuild checking for Mono.Posix.dll... found checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating dbus-sharp-2.0.pc config.status: creating src/AssemblyInfo.cs config.status: creating src/Makefile config.status: creating tools/Makefile config.status: creating examples/Makefile config.status: creating tests/Makefile + make -j4 Making all in src /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/bin/xbuild /nologo /verbosity:quiet dbus-sharp.csproj /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/lib/mono/4.0/Microsoft.CSharp.targets: warning : A circular reference was found involving the import of '/Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/lib/mono/4.0/Microsoft.Common.targets'. It was earlier imported by '/Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/lib/mono/4.0/Microsoft.CSHARP.Targets'. Only the first import of this file will be used, ignoring others. /Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/lib/mono/4.0/Microsoft.CSharp.targets: warning : A circular reference was found involving the import of '/Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/lib/mono/4.0/Microsoft.Common.targets'. It was earlier imported by '/Users/gnomeuser/Documents/Projekter/bockbuild-timo/profiles/banshee/build-root/_install/lib/mono/4.0/Microsoft.CSHARP.Targets'. Only the first import of this file will be used, ignoring others. Protocol/MessageReader.cs(579,25): error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type T' Protocol/MessageWriter.cs(431,26): error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed typeT' make[1]: *** [dbus-sharp.dll] Error 1 make: *** [all-recursive] Error 1

DavidNielsen avatar Nov 07 '13 12:11 DavidNielsen

Same problem here. Apparently it isn't legal to take the address of a value of a managed type; the Mono C# compiler has only recently become strict enough about it.

RavuAlHemio avatar Dec 06 '13 23:12 RavuAlHemio

Hi, I've just added a Pull Request to fix this issue. Here is the url of the pull request: https://github.com/mono/dbus-sharp/pull/30 Try if this works for you. Thanks

LascauxSRL avatar Dec 20 '13 09:12 LascauxSRL

Yup, seems to have fixed it for me.

RavuAlHemio avatar Dec 21 '13 04:12 RavuAlHemio