0

I have a .Net program, which works fine using "mono Program.exe", but now I am trying to use "mkbundle -o prog Program.exe --deps" on the SAME machine, and it returns the following error:

/usr/bin/ld: skipping incompatible /opt/novell/mono/lib/pkgconfig/../../lib/libmono-2.0.so when searching for -lmono-2.0 /usr/bin/ld: skipping incompatible /opt/novell/mono/lib/pkgconfig/../../lib/libmono-2.0.a when searching for -lmono-2.0 /usr/bin/ld: cannot find -lmono-2.0 collect2: ld returned 1 exit status

The system is CentOS 5.7 on x86_64. I have installed mono on this system using these instructions. Does anyone know why mono works, but mkbundle doesn't? How can I fix it?

Tofig Hasanov
  • 3,303
  • 10
  • 51
  • 81

1 Answers1

1

You likely installed the 32bit version of mono (which works on x86_64 systems like yours), but mkbundle will try to compile with the default compiler settings (which are 64bit) and only find the 32 bit version of the library. To solve the issue you have either to install the 64 bit version of mono to match your system or (assuming you install also the rest of the needed 32 bit libraries, like libc and compilers) compile with mkbundle in 32 bit mode, by adding the -m32 option to the compiler command line that mkbundle prints on the console (you'll also need to use the -c option to mkbundle).

lupus
  • 3,963
  • 1
  • 18
  • 13
  • Sorry, this seems a little confusing to me. How do I know if I installed 32 bit version of mono or 64? The mono is installed into /opt/novell/mono/ folder, and I see a lib64 folder there. But then, when I type "mono -V", it says that architecture is x86. What does it mean? Also, if I understood your solution correctly, I need to use "mkbundle -c -o program Program.exe --deps", and then what? – Tofig Hasanov Jan 09 '12 at 08:25
  • If mono -V says x86 you have the 32 bit executable. Make also sure you have only one mono installed (running 'which -a mono' in a terminal). – lupus Jan 10 '12 at 10:00
  • For the solution, first run mkbundle2 --deps Program.exe and note the compiler command line (it looks like "cc -ggdb ..."), then run mkbundle2 again with the -c option. After that run the compiler command line shown earlier, but adding also the -m32 option. – lupus Jan 10 '12 at 10:03