PDA

View Full Version : Winnt to unix or linux



08-21-2002, 04:46 AM
I have a small opengl program(full of opengl codes, no windows codes) created using VC++ 6.0(Winnt). I want to run that program in linux system.

Is it ok if I copy the .exe file? Will it work?

Thanks guys
Simon

Robbo
08-21-2002, 04:53 AM
No, I can more or less guarantee with my life it won't work http://www.opengl.org/discussion_boards/ubb/wink.gif

You should compile the code on the given platform to see if it still works. The only way to get something working on all those platforms with the same code is to use a virtual machine\interpreter such as Java.

nexusone
08-21-2002, 05:03 AM
The exe file is made to run under windows operating system.

In order for it to run with linux/unix, you will need to take your source code and compile it to a linux/unix binary.

If your source has not windows calls, then it should be able to be compiled with gcc or some other linux/unix compiler.



Originally posted by simonH:
I have a small opengl program(full of opengl codes, no windows codes) created using VC++ 6.0(Winnt). I want to run that program in linux system.

Is it ok if I copy the .exe file? Will it work?

Thanks guys
Simon

08-21-2002, 05:09 AM
all opengl codes with bit of `C` codes. Even i'm creating the window using glutcreatewindow.
does it means if i execute the code in unix/linux will it work?

coredump
08-21-2002, 05:14 AM
no because the compiler you used (MSVC++) created an executable that (only) a Windows OS can read. it must be recompiled on the OS you want to run on. even a program with only one printf call in the main function would have to be recompiled.

b

08-21-2002, 05:21 AM
Heard that opengl is platform independent.

this means that if i RECOMPILE my code in linux/unix will it work?



Originally posted by simonH:
all opengl codes with bit of `C` codes. Even i'm creating the window using glutcreatewindow.
does it means if i execute the code in unix/linux will it work?

killercow
08-21-2002, 09:01 AM
openGL is platform independent because you can program for it for any system. directX is not because you can only program for that in windows 98 or above! well for 8.1 anyway

nexusone
08-21-2002, 09:10 AM
Yes, opengGL is platform independent, glu library and glut library also.
But what platform independent means is that if you write code following the guide lines set forth by opengl, glu, and glut.
The any system with a compiler that has opengGL library support will compile that program into exe file for that system.

Even though you have wrote the program under VC++ to meet the guide lines for crossplatform support under openGL. The VC++ compiler put's windows only code in the exe file. The same is true if you compiled it under linux, a linux compiler will put code that only will run on a linux machine.

As you learn more about computers and programming this will become clear to you.

http://www.opengl.org/discussion_boards/ubb/smile.gif


Originally posted by simonH:
Heard that opengl is platform independent.

this means that if i RECOMPILE my code in linux/unix will it work?

08-23-2002, 04:09 AM
So what you guys are saying is, if I RECOMPILE my code in linux/unix it will work. Am I right?

simon

nexusone
08-23-2002, 04:45 AM
Yes!

http://www.opengl.org/discussion_boards/ubb/smile.gif



Originally posted by simonH:
So what you guys are saying is, if I RECOMPILE my code in linux/unix it will work. Am I right?

simon