Slashdot Mirror


Compiling Under Wine

now3djp writes "Interesting article over on CodingStyle that demonstrates how I successfully eliminated wasted time maintaining an MS-Windows computer when I could build natively from my GNU computer! /. has followed other cross compilers in the past. This article is different because I used MS's own compiler! This allowed me to get on with real games porting; with only a proportional increase in compile time. Wine has really come a long way in supporting simple apps, let us hope it reaches a 1.0 soon."

18 of 322 comments (clear)

  1. Awesome by Anonymous Coward · · Score: 3, Insightful

    I can't wait til we have a fully functioning windows emulator. Even if it will kill the need for native apps (read games).

    1. Re:Awesome by Anonymous Coward · · Score: 0, Insightful

      i fail to see why you don't just use windows. it seems to be what you're looking for.

      a) windows is, and will always be further along than wine. chasing an API puts you in second place, from the moment you start.

      b) vmware can run windows fine. it's not expensive, and it'll run most things better than wine ever will, if you want to actually get some work done (i used it for almost a year to do PCB design and circuit design using protel for uni, and this was on a celeron 366!)

      c) killing games is stupid. you're just going to make linux less attractive to developers (who won't give too hoots that we need to bend over backwards to use wine, let alone attempt to get a proper port), and what with added cheat detection, wine will probably get marked as a "cheat" more and more often.

      d) i doubt wine will ever be fully useful for newer games. you're better off just supporting openGL in the first place, simply because wine will need to provide an directx wrapper around openGL anyway. may as well go straight to the source.

      of course, you could just want to see linux fail. there's nothing *wrong* with that notion. i just don't see what's right about it. wine won't save you anything, except from RSI, since you won't be using it to do anything but watch games crash and run slowly.

      ashridah

    2. Re:Awesome by harlows_monkeys · · Score: 5, Insightful
      Be careful what you wish for. It's excellent handling of Windoze apps is part of what killed OS/2. Developers: "Why port it when it can run the windoze version?"

      I don't believe that this is actually true. Win95 had excellent Win3.x compatibility, but developers nevertheless rushed to develop Win95 software. Why would Win3.x compatibility in OS/2 cause developers to forego native development, but not have the same effect on Win95?

      I believe that what really killed OS/2 was IBM's attitude toward developers. Microsoft made it trivial to get started in Win95 development. Hell, you could go into Egghead and buy an MSDN subscription and all the tools you needed.

      Compare to OS/2, where you had to apply to IBM for permission to develop, and buy an expensive development kit (at least, to officially develop).

      I believe it was Jerry Pournelle who wrote of his experiences at a trade show, where he went to the MS booth, and asked what he had to do to develop for the upcoming Win95, and they handed him, on the spot, a development kit. At the IBM booth, he asked what he had to do to develop for OS/2 (a system that was already for sale, unlike Win95, which was still in beta). Did they hand him a development kit? Nope. They handed an application. If they decided he was worthy, he'd be allowed to buy a development kit.

      I think that is the reason OS/2 development never took off.

      Note! I'm not saying for-pay developer programs necessarily kill a platform. Apple used to have a for-pay program, but it was a joy, because of the astounding support. You sent any question off to DTS, and they would quickly have a good engineer, with full access to the source and the developers, answer it. I was having trouble with interrupt handling in a device driver, and they send me the detailed comments from the ROM source code for the interrupt handler, which explained exactly what was going on.

      With Apple DTS, the feeling I had as a developer was that I was dealing with my peers at Apple, who wanted to cooperate with me to make something great. With IBM, I always felt like an insignificant pawn in whatever they were doing.

    3. Re:Awesome by AvitarX · · Score: 4, Insightful

      Ummm, it has.

      Linux has far surpassed where OS/2 was, and is growing in use. Linux's total openness is a part of it's success (another part being it's freeness).

      Linux has a large share of web servers. A large share of new super computer instellations. A large share new renderfarm instellations. A large share of scientific workstation instalations. A growing share in educational desktop installations. And a growing share in governmental type settings.

      Linux is seriously taking off in a big way. It is HUGE and has far surpassed OS/2.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    4. Re:Awesome by rseuhs · · Score: 4, Insightful
      It's excellent handling of Windoze apps is part of what killed OS/2.

      Nonsense, OS/2 was killed because PC-makers didn't want to use an OS from a competitor.

      "Why port it when it can run the windoze version?"

      Great, so you would rather have them ask "Why port it at all when 100% of our customers use Windows?"

      Not exactly the same, but it would be much better to have native apps,

      Sure, but we have to get a significant amount of users first, then can we expect native apps.

      Wine helps building that userbase.

      Instead of developers asking "Why port it when it can run the windoze version?" we have to have users asking "Why use Windows when Linux can run Windows and Linux apps?".

    5. Re:Awesome by rseuhs · · Score: 2, Insightful
      a) windows is, and will always be further along than wine. chasing an API puts you in second place, from the moment you start.

      Wrong. An API is by definition a fixed implementation that does not change at a later time. Of course there are additions, but those are not used until most of the userbase supports that extensions (which gives Wine a lot of time to incorporate those extensions).
      Almost all Win32 software runs on Windows 98 (5 years old), most runs even on Windows95 (8 years).

      b) vmware can run windows fine. it's not expensive, and it'll run most things better than wine ever will, if you want to actually get some work done (i used it for almost a year to do PCB design and circuit design using protel for uni, and this was on a celeron 366!)

      Well, it *is* expensive. More expensive than Windows. And you still need Windows, too. And I did not even start to talk about the speed problems.

      Also, it can't be incorporated with distributions, therefore distributions can't run Win32-apps "out of the box", but with a good Wine, they can.

      c) killing games is stupid. you're just going to make linux less attractive to developers (who won't give too hoots that we need to bend over backwards to use wine, let alone attempt to get a proper port), and what with added cheat detection, wine will probably get marked as a "cheat" more and more often.

      We have to build a userbase before expecting any native games. Without Wine, there will not be a gaming userbase, period. So Wine is the only way to make Linux a gaming platform.

    6. Re:Awesome by andrewski · · Score: 2, Insightful

      I would assert that there are more programs for Linux , or more accurately that can be compiled for it and that the api / libs /etc that it requires are supported, than there are for Windows. I would also assert that more innovation and research occurs for Linux than any other platform. I personally think it has in most ways that count surpassed Windows.

      You can roll and smoke that.

    7. Re:Awesome by afidel · · Score: 3, Insightful

      Wrong. An API is by definition a fixed implementation that does not change at a later time.

      Try to tell that to the folks in Redmond. MS has done a great diservice to the idea of object re-use, they often fail to follow one of the most basic ideas of OO, that is you can extend but never change an interface. Almost every single service pack changes the interfaces to dozens and dozens of parts of the windows api. This is why we have "dll hell". If MS followed basic principals it wouldn't be a problem because rather than reworking the interface they would simply add new additions to the interface and depricate the old ones (leaving the origional interface and associated code so that programs would still get the behaviour they expect).

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    8. Re:Awesome by scrytch · · Score: 2, Insightful

      So why hasn't Linux taken off yet?

      Because good sized chunks of the development kit does not come with linux. Go browse the MSDN library CD, or browse it online. Check out the support for an object model that guarantees that any language the major compiler vendors put out, as well as a plethora of scripting languages, will be able to interface with it. I can script my mail app with everything from VB to python to C++. I am buried in more voluminous documentation than I will ever have time to read.

      To say for a Linux dev environment "some assembly required" is to grievously understate the problem. The only thing a Linux environment has going for it in terms of documentation is a much bigger base of sample code.

      It costs real money to put together a good development kit. But just ask Carmack why he prefers to develop on NT.

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
  2. compiling? by Anonymous Coward · · Score: 5, Insightful

    It's not so interesting to me that he managed to compile using VC++ under WINE. VC++ doesn't call any of the APIs you code, it just puts machine code into the file saying you can call them if you want. It's all well and good to have VC++ compile DX9_CreateSurface() (or whatever) into a bunch of PUSHs, POPs and a JMP instruction, but that doesn't help if WINE can't actually call that function when you're testing. It makes more sense to me to use Bochs or VMWare to test your application if you're developing on multiple platforms. Anything less would be short-changing your Windows clients.

  3. WRONG! by www.sorehands.com · · Score: 4, Insightful
    It may eliminate the need for a reasonably fast machine to develop on, but you always need a target machine for testing! But, the test machine should be slow so that one can find performance bottlenecks and see the program operate under non-optimal conditions.


    If the people are forced to test applications on slow machines, we may not have word processors that need 40MB of ram and a 933MHZ pentium III to run.

  4. I use Wine to compile but not for porting by Captain+Rotundo · · Score: 4, Insightful

    I use Microchip's pic assemler through wine, for a small piece of code I maintain that runs on a PIC that wasn't supported by any GNU/Linux assembler when I started. I also maintain a legacy version of a very specific proprietary MSDOS (actually we run DRDOS) program that was written with Borland C, hopefully I will be replacing the last running bit of that with a DJGPP compiled version soon, which of course can be cross compiled on GNU/Linux without the need for Wine and bcw.
    I know what your thinking, but when a piece of software has worked flawlessly (well almost!) for 15 or so years, and is 'mission critical' it is very hard to drop a platform and move on. I am hoping to try out a move to Linux some day in the near future so that I can take advantage of new features and things that just arent available for DOS. But unless I can convince everyone else of the benefits I may be supporting dos for quite some time (I am the only software person at this company).

  5. This is non-news. by Doomrat · · Score: 4, Insightful

    Visual C++ doesn't do anything weird regarding Windows API. The IDE is a normal affair, and the compiler could be run without a user interface. It's really not testing Wine to it's limitations and the irony of situation is barely worth commenting on. This is non-news, the only thing this article achieves is to make Slashdot look like the anti-MS geeks with limited social awareness. Some things just aren't worth giggling at.

    I don't even need to look at the poster to know that this is the work of micheal...

  6. GNU/WINE?!?! by Arandir · · Score: 2, Insightful

    What the fsck is "GNU/WINE"! Aaargh! It's one thing to give RMS some credit, but this reeks of puerile toadying in an effort to look sophisticated in front of other juvenile sycophants.

    Repeat after me, "WINE is not a GNU project!"

    --
    A Government Is a Body of People, Usually Notably Ungoverned
  7. Re:which begs the question by critter_hunter · · Score: 2, Insightful

    Don't like their STL? Use STLPort! Bonus points if you can compile it under Windows using their incredibly sucky installation instructions, which sorta ... stop in the middle of the process.

    --
    Karma: Could be worse (could be raining)
  8. Actually by Sycraft-fu · · Score: 2, Insightful

    I think if you are serious about cross platform development, you need to have a native install of all the platforms you intent to port to. Either multi-boot or seperate boxes. Why? Well amy emulator, WINE espically but even VMWare, has certian quirks and differences that native hardware does not. You need to test it as it will be run to be sure. Also, if you are using any advanced 3d function, the emulators are going to fall flat on their faces.

    If I were really serious about a commercial cross platform release, say Windows and Linux I think I would want a ton of testing. I'd probably want at least 3 different systems, all tht had a copy of Windows 98, ME, 2k, and XP plus at least 3 big Linux distros. While in theory something complied for any hardware under any verison of Windows should work on any other, it's just not the case. Same for Linux. You want to test for the little "gotchas" if you want to make sure you have a really stable software.

  9. Safe performance by fizbin · · Score: 2, Insightful

    The safest bet is to not have your job depend on tweaking the last little bit of performance out of a customer's machine when you have only a vague idea of which platform they might be running on. Either improve your algorithms in the whole, or hide the slow performing code in a place where the user won't notice. (if possible)

    That said, another option is to isolate the performance-critical sections into chunks of code which get optimized separately and then have cpu-detection code choose the appropriate chunk at runtime. The debian atlas packages do something like this, though (AFAIR) they use hand-optimized assembly instead of just using compiler flags and/or different compilers. (and yes, you can have both the sse- and 3dnow-optimized packages installed on the same machine, and the code will load the appropriate shared library at runtime)

    Then, instead of standardizing on a compiler, you'll need to standardize on a build system that will let you compile the code as you need it compiled.

  10. You are ignorant. by Tord · · Score: 2, Insightful
    Your dissection of the authors knowledge is strongly flawed.

    The author first asserts that the process of moving files between the systems causes the upper/lower caseness of the filenames to be munged

    This is the case, I've run into this problem myself many times and it has little to do with how the files are saved and much to do with how fs-drivers are implemented and configured. Compare to how you often end up with read-only files if you copy them from a CD in Linux. Sure you can change some settings, but then often get other side-effects in other situations (goes for both). I believe he is the original author of his project.

    The author displays no knowledge of the network mounting of filesystems using SAMBA (CIFS) or NFS.

    The fact that he is dual-booting strongly suggests that he (like most of us) only has one development machine, not a complete network of machines. Don't get ignorant just because you are better equipped.

    Why isn't the source code checked into a configuration management tool, like CVS?

    Once again, he only has one workstation, thus is CVS out of the question since it needs to be hosted under one of the OSes and he can only run one at once. Besides, CVS is in most cases just unnecessary and complicates and slows stuff down if you are the single developer. You can make backups through normal file copying.

    As others have already noted elsewhere, he will still have to test on the target platform.

    Which I'm sure he does now and then too (by dual booting). However, if you just need to do some minor change in platform independent code it's really a bliss to not need to dual-boot.

    Besides, your criticism of using VMWare for testing is quite irrelevant. It's true you need to test on multiple environments to know that it works on them all, but as you said, VMWare with Windows X *IS* one of these environments. If he's dual booting he only has access to one environment anyway, using VMWare as well will add one or more extra testing environments.

    I would have LOVED to have a similar setup as his when I was developing BladeEnc. Like him I only had one development machine (couldn't afford more) and constantly needed to dual-boot in order to recompile and package a new version. The platform dependent parts of BladeEnc were very limited and untouched for 95% of the development, thus this setup + testing under wine (for possible quality degradation due to compiler excentricities) would have been more than enough during most of my days. Only performance tweaking would have to be done in windows environment.

    With your 20+ years as software developer you obviously have found your way of working in your projects and with your budget. Don't knock others creative solutions for solving their problems with their resources in a totally different situation.