[Mono-list] P/Invoke on amd64 was :Marshalling problems

James Fitzsimons james.fitzsimons@gmail.com
Sun, 13 Feb 2005 12:41:35 +0000


--=-MksUCtZHEQDzc7mUeMZ4
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hi Michal,

On Sun, 2005-02-13 at 11:48, Michal Moskal wrote:
> Ok, this one was stupid :-) glib uses dlopen to open the module and
> the message seems to come from dlopen. Maybe you can try to write a
> little C program that only dlopens libncurses.so and see if it works.

Ok. I just tried this:
#include <stdio.h>
#include <dlfcn.h>

int main(int argc, char **argv) {
  void *handle;
  char *error;

  handle =3D dlopen ("libncurses.so", RTLD_LAZY);
  if (!handle) {
    fprintf (stderr, "%s\n", dlerror());
    exit(1);
  }
  else {
    fprintf (stdout, "Opened libncurses successfully\n");
  }

  dlclose(handle);
  return 0;
}

built with the following command:
james@athos src $ gcc -rdynamic -o dlopentest dlopentest.c -ldl

And result:
james@athos src $ ./dlopentest=20
Opened libncurses successfully

Humm.. seems to work. Unfortunately I am getting a bit out of my depth
here. I still have a lot to learn about Linux programming it would seem
;-)=20

I am following up on another theory as well to do with the version of
gcc used to build mono. I will let you know if that makes any
difference.

Cheers,
James

--=20
It's 5.50 a.m.... Do you know where your stack pointer is ?

--=-MksUCtZHEQDzc7mUeMZ4
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBCD0r/tf4qL6AoafMRAlcxAKDNB6Gfm3k29QVGRQSwozePEjdI+ACg00NN
2pMsu9/4VrxdLbtz2VsuWdg=
=MJcB
-----END PGP SIGNATURE-----

--=-MksUCtZHEQDzc7mUeMZ4--