[Wine] How do you compile a simple application with winelib?

WK1 wineforum-user at winehq.org
Thu Oct 1 11:51:55 CDT 2009


I read the winelib users guide: http://www.winehq.org/docs/winelib-guide/index but the instructions there don't work any better than what I had tried on my own. "undefined reference to ..." in proportion to the size of the program.
Notepad will not compile with the instructions there, and the notepad Makefile provided in the source archive will only compile a program for Windows, which I can already do with mingw32. This is true for both the wine 1.0.1 and 1.1.30 source archives.

I want to compile a linux binary with winelib. I have wine installed. Here is the application I wish to compile:

Code:
#include <windows.h>

int main(int argc, char ** argv)
{
	MessageBox(NULL, "Hello, World!", "Title", MB_OK);
}



Here is the command I have tried:

Code:
wineg++ -o tmp tmp.c



And here is the error message:

Code:
tmp-u6eMwW.o: In function `main':
tmp.c:(.text+0x41): undefined reference to `MessageBoxA'
/usr/bin/ld: tmp.exe.so: hidden symbol `MessageBoxA' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
winegcc: gcc failed



I am sure that what I need to do is obvious to anyone who knows how, but the documentation on this matter is so sparse, and at times incorrect, that it is hard to learn.







More information about the wine-users mailing list