[Wine] My first winelib app - where am I going wrong?

nonoitall wineforum-user at winehq.org
Tue Dec 16 17:43:53 CST 2008


I eventually want to write a Linux application that can load Windows DLLs using winelib (I can do that, right?) but to start off, I just wanted to do a little Hello World test.  Here's what I've got:

main.c

Code:
#include <windows.h>

int main(int argc, char** argv) {
	
	MessageBox(NULL, "Hello world.", "Hello", MB_OK);
	
	return 0;
	
}




This compiles fine using Mingw32 and I can successfully run the resulting binary in Wine:

Code:
i586-mingw32msvc-gcc *.c -o main.exe
wine main.exe



Now I try to compile the same code with Winelib, but I'm having problems:

Code:
winegcc -mwindows -mno-cygwin *.c -o main
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../libm.a when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for -lm
/usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
/usr/bin/ld: cannot find -lm
collect2: ld returned 1 exit status
winegcc: gcc failed



I also tried using winemaker on the source file and using make with the generated makefile, but ran into the same problem.  I'm using Ubuntu 8.10 x64 if that's significant.  Any tips on how to get Hello World working?  Thanks in advance.







More information about the wine-users mailing list