Hi,
I have a huge amount of Windows code that I'm porting to Linux.
Wine is turning out to be a read godsend, thank you guys!
Anyway, I've had tons of luck including the directory <wine_dir>/include/wine/windows in my include path. All my Windows types are there and everything is wonderful. I've even been able to link against the libraries by renaming, for example, foo.dll.so to libfoo.so and using -lfoo on the g++ command line.
I actually haven't got all my functions defined so I don't know if this will actually run yet because the link isn't complete yet.
My first question is whether this will work. Will all my Windows functions with function declarations defined in the windows directory and code compiled into foo.dll.so actually run?
Second, I see that some of the functions I want to use are actually defined by headers in the msvcrt directory. However, this directory contains tons of header files that my system (and gcc) also have under /usr/include and gcc's own directories. I understand that msvcrt is Windows lib c, but I wonder how I'm supposed to use it with gcc to compile? I've tried -nostdinc to gcc, but the number of errors I get is enormous.
It's not the end of the world if I can't use Wine's msvcrt, but if I could use it, it would define dozens more functions on which my program relies, or if its use was mandatory in order to get the functions implemented in foo.dll.so to work, then obviously I wonder how I'm supposed to compile my Windows code with Wine to make everything work?
I'm sorry if this is a dumb question. I can't find a way to search the wine-devel mailing list other than with google and I can't find anything on there or other docs that answer this question, which I'm sure has been asked a million times and has a simple answer.
Thank you thank you,
Jeff
_________________________________________________________________ Send e-mail faster without improving your typing skills. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_1...
Hi,
I have a huge amount of Windows code that I'm porting to Linux.
Wine is turning out to be a read godsend, thank you guys!
Anyway, I've had tons of luck including the directory <wine_dir>/include/wine/windows in my include path. All my Windows types are there and everything is wonderful. I've even been able to link against the libraries by renaming, for example, foo.dll.so to libfoo.so and using -lfoo on the g++ command line.
I actually haven't got all my functions defined so I don't know if this will actually run yet because the link isn't complete yet.
My first question is whether this will work. Will all my Windows functions with function declarations defined in the windows directory and code compiled into foo.dll.so actually run?
Second, I see that some of the functions I want to use are actually defined by headers in the msvcrt directory. However, this directory contains tons of header files that my system (and gcc) also have under /usr/include and gcc's own directories. I understand that msvcrt is Windows lib c, but I wonder how I'm supposed to use it with gcc to compile? I've tried -nostdinc to gcc, but the number of errors I get is enormous.
It's not the end of the world if I can't use Wine's msvcrt, but if I could use it, it would define dozens more functions on which my program relies, or if its use was mandatory in order to get the functions implemented in foo.dll.so to work, then obviously I wonder how I'm supposed to compile my Windows code with Wine to make everything work?
I'm sorry if this is a dumb question. I can't find a way to search the wine-devel mailing list other than with google and I can't find anything on there or other docs that answer this question, which I'm sure has been asked a million times and has a simple answer.
Thank you thank you,
Jeff
Send e-mail faster without improving your typing skills. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_1...
Just compiling your program using g++ won't work as Wine needs to perform a lot of magic. For that reason Wine ships with its own gcc/g++ wrapper programs called winegcc/wineg++ both are mingw compatible. You should build your program using that and it won't have issues linking with wine libraries and it also allows you to link against linux libraries.
Roderick
Roderick,
Thanks for your answer.
Unfortunately, I will not be able to use wineg++ for a variety of political reasons.
Is there anyway, even if it involves some non-standard hacking, to get the Windows functions defined in <wine_install_dir>/include/wine/windows to be compiled in a library that I can directly link to with g++ without using wineg++?
I mean, wine is all c code right? And it's compiled with the g++ on my system?
Has no one ever wanted to do this before?
Jeff
Date: Thu, 11 Dec 2008 09:32:53 +0100 From: thunderbird2k@gmx.net Subject: Re: compiling Windows code with g++ on Linux using msvcrt - good idea? if so, how do you do it? To: foobarbaz99@hotmail.com; wine-devel@winehq.org
Hi,
I have a huge amount of Windows code that I'm porting to Linux.
Wine is turning out to be a read godsend, thank you guys!
Anyway, I've had tons of luck including the directory <wine_dir>/include/wine/windows in my include path. All my Windows types are there and everything is wonderful. I've even been able to link against the libraries by renaming, for example, foo.dll.so to libfoo.so and using -lfoo on the g++ command line.
I actually haven't got all my functions defined so I don't know if this will actually run yet because the link isn't complete yet.
My first question is whether this will work. Will all my Windows functions with function declarations defined in the windows directory and code compiled into foo.dll.so actually run?
Second, I see that some of the functions I want to use are actually defined by headers in the msvcrt directory. However, this directory contains tons of header files that my system (and gcc) also have under /usr/include and gcc's own directories. I understand that msvcrt is Windows lib c, but I wonder how I'm supposed to use it with gcc to compile? I've tried -nostdinc to gcc, but the number of errors I get is enormous.
It's not the end of the world if I can't use Wine's msvcrt, but if I could use it, it would define dozens more functions on which my program relies, or if its use was mandatory in order to get the functions implemented in foo.dll.so to work, then obviously I wonder how I'm supposed to compile my Windows code with Wine to make everything work?
I'm sorry if this is a dumb question. I can't find a way to search the wine-devel mailing list other than with google and I can't find anything on there or other docs that answer this question, which I'm sure has been asked a million times and has a simple answer.
Thank you thank you,
Jeff
Send e-mail faster without improving your typing skills. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_1...
Just compiling your program using g++ won't work as Wine needs to perform a lot of magic. For that reason Wine ships with its own gcc/g++ wrapper programs called winegcc/wineg++ both are mingw compatible. You should build your program using that and it won't have issues linking with wine libraries and it also allows you to link against linux libraries.
Roderick
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a
_________________________________________________________________ Suspicious message? There’s an alert for that. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_...
Am Donnerstag, den 11.12.2008, 20:13 +0000 schrieb foobarbaz biffblaff:
Unfortunately, I will not be able to use wineg++ for a variety of political reasons.
Too bad. Do you understand that wineg++ is not completely different compiler, but just a 21K binary (stripped) that does the needed option magic to invoke g++ with the right options? It is perfectly OK to use winegcc/wineg++ to link unix libraries into your windows program. It is not possible to generate a library any unix program can just open and use this way, as winelib code needs special startup code. winegcc / wineg++ takes care of it in the final linking step.
Is there anyway, even if it involves some non-standard hacking, to get the Windows functions defined in <wine_install_dir>/include/wine/windows to be compiled in a library that I can directly link to with g++ without using wineg++?
The functions are in libraries that g++ can link. These libraries are in /usr{/local}/lib/wine and called foo.dll.so, where foo is the name of the Windows DLL you need.
I mean, wine is all c code right? And it's compiled with the g++ on my system?
The wine build system uses winegcc, which in turn uses gcc.
Has no one ever wanted to do this before?
No one ever feeled inclined to duplicate the functionality of winegcc because it is small, quick readily available and just works.
I'm sorry that I can't really help you, but I don't understand your motivation to go that way and what problems you are trying to solve.
Regards, Michael Karcher