Winnt to unix or linux

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

No, I can more or less guarantee with my life it won’t work

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.

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:
[b]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[/b]

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?

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

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?

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

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.

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

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

[/b]

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

simon

Yes!

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

simon[/b]