Advertisement

Why aren't there more Linux ports of Windows applications?

Started by October 11, 2003 03:24 AM
31 comments, last by Peon 21 years ago
quote: Original post by Spencer
actually, my not so very humble opinion on this matter is that blaming on linux that a program crashes is just a lame excuse for not learning to program deacently. It is a major concern i computer science to write portable code and separeate GUI from network and core etc. Okay, i know that linux have problems with graphics drivers, in fact i get lousy fps values with my intel740 card, but the solution is not to give up linux as a gaming platform. We have right now very good 3d driver both from nvidia and ATI is working a great deal on it. DRI is doing a really good job too. Also WINE and WINEX makes it possible to play dx games on linux..at least some of them so actually i agree with peon: why arent there more programs ported to linux.....

thank you



--Spencer

"Relax, this dragon is sleeping..."


I know how to program decently, and I know that there are no errors in my code that should be causing the crash. I have tried changing many things and there are others with the same issue, so it''s not just me (and I didn''t copy their code either, so multiple people coming upon the exact same issue with a driver call... hmm, must be all of us can''t code). Learn not to disrespect people when you know nothing about me, or my coding style. My network code, gui, etc are ALL seperated, and all OS specific code is in a single class like I said, so by replacing this class (inherit a base class, and fill in required functions), I can run my engine under any OS, or at least that was the plan. I wrote a linux version, and the class works fine, but the other code that was OS independant (plain old opengl calls, etc) were the ones having problems. I''m positive it''s not my code, because I can compile code from other people and it does the exact same thing (nehe code for example).
I had several problems converting my "cross-platform" SDL game into Linux. Most of them were related to incompatibilities in the compilers. Try the following code in MSVC:
int main() {	for (int i=0;i<5;i++){}	for (int i=0;i<5;i++){}	return 0;}

In MSVC 6 (at least the version I have), it came up with some error about redefinition of ''i''. I can''t tell you the exact error because I''m not in Windows now. In g++, it compiled fine. But if you remove the second int, it works find in MSVC, while g++ says:
g++ error.cc
error.cc: In function `int main()'':
error.cc:3: error: name lookup of `i'' changed for new ISO `for'' scoping
error.cc:2: error: using obsolete binding at `i''

That''s with the following output from g++ --version:
g++ (GCC) 3.3 20030226 (prerelease) (SuSE Linux)

And for non-games, its even harder. Have you ever made a GUI in C for Windows or XWindows? No matter how much design you put into it, its not fun. And Java is just plain ugly.
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
Advertisement
Ready4Dis: If I remember your situation correctly, you posted a stack trace of the crash at some point, right? It did look like a driver problem from the quick glance I gave it. Did you bother to report it to the people responsible for writing the driver? If you''re using proprietary drivers, report it to whoever supplied them. If it looks like it was DRI, report it to them. If you want them to pay attention, give them a minimal recreation of the problem. It''ll probably get fixed if it''s as serious as you try to make it sound.

Clum: That''s because MSVC 6.0 is a horrible compiler. Generally, stick to standard and learn the quirks of compilers you''re targeting. Once you have more experience, avoiding such issues isn''t something you have to worry about, it just comes naturally.

I actually resorted to:

#ifdef WIN32
#define I i
#else
#define I int i //prevent ANSI scope warnings which MSVC doesn''t support
#endif

and then using for (I=0;...;...)...

and making sure that I don''t use any variables called I in my program.
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
OT: There's a better trick than that, IIRC
#define for if(0) {} else for

[edited by - Magmai Kai Holmlor on October 12, 2003 11:43:48 PM]
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
quote: Original post by Magmai Kai Holmlor
OT: There''s a better trick than that, IIRC
#define for if(0) {} else for

[edited by - Magmai Kai Holmlor on October 12, 2003 11:43:48 PM]


That''s pretty clever. I had to think about that for a while to realise what it did. However, my method is slightly more efficient, though much less clean. I think I''ll switch over to your method as soon as I get around to it (even though it means programming MSVC style instead of ANSI C++ style).
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
Advertisement
quote: Original post by Null and Void
Ready4Dis: If I remember your situation correctly, you posted a stack trace of the crash at some point, right? It did look like a driver problem from the quick glance I gave it. Did you bother to report it to the people responsible for writing the driver? If you''re using proprietary drivers, report it to whoever supplied them. If it looks like it was DRI, report it to them. If you want them to pay attention, give them a minimal recreation of the problem. It''ll probably get fixed if it''s as serious as you try to make it sound.

Clum: That''s because MSVC 6.0 is a horrible compiler. Generally, stick to standard and learn the quirks of compilers you''re targeting. Once you have more experience, avoiding such issues isn''t something you have to worry about, it just comes naturally.




Yeah, you remembered correctly, and it was a DRI driver I beleive. I am going to try a few more things before I report it, as I don''t want to waste their time (although, i''ve wasted plenty of mine so far ).

Also, I would recommend you NOT introduce variables in the middle of your program like that. If you must have a variable like i, just define it at the top of the function. I normally reserve a variable "int Ctr;" at the top of each of my functions that contain for loops, that way I don''t have to worry about compiler differences, I just write for (Ctr=0;Ctr!=SomeNumber;++Ctr) { } and it works under vc 1.0, vc 6.0, g++, codewarrior, cygwin, etc, etc.
quote:
Learn not to disrespect people when you know nothing about me, or my coding style. My network code, gui, etc are ALL seperated, and all OS specific code is in a single class like I said, so by replacing this class (inherit a base class, and fill in required functions), I can run my engine under any OS, or at least that was the plan. I wrote a linux version, and the class works fine, but the other code that was OS independant (plain old opengl calls, etc) were the ones having problems.


i am sorry if you took it personal, and i know now that it might have come out that way. This was not what i intended.
My opinion is just that people seem to think that you cant code for linux or that it is a platform for boring universities and stuff, but this is not the case nowdays. Sorry again...

--Spencer"All in accordance with the prophecy..."
Unless I''m missing something and this is a funny...

When I ran into this little ''issue'' the solution was the (to me) obvious:
int main(){    int i;    for (i=0;i<5;i++){}    for (i=0;i<5;i++){}    return 0;}


Now personally I tend to prefer the non standard ms way but perhaps that is just because that is how I learned to do things. I''m definatly for standards though.
quote: Original post by FeralofFireTop
Unless I''m missing something and this is a funny...

When I ran into this little ''issue'' the solution was the (to me) obvious:
...
Now personally I tend to prefer the non standard ms way but perhaps that is just because that is how I learned to do things. I''m definatly for standards though.


That''s basically what Ready4Dis said, but I prefer to declare the variable inside the loop simply because it looks nicer and it doesn''t allow the counter to get mixed in with the rest of the program.
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)

This topic is closed to new replies.

Advertisement