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.
WK1
2009-Oct-01 17:44 UTC
[Wine] Re: How do you compile a simple application with winelib?
I got my simple program to work. It turns out that I had some junk in my /usr/lib/wine directory that I added in an attempt to get winelib to work, before I discovered winegcc. I removed it, and it works now. The notepad2 example still won't work without some adjustments, but I know how to do that now.