Author |
Message |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
This is more of a query than an actual question.
Just started learning C++ and I've read that the .cpp file(s) has to be compiled for the specific OS and CPU etc... in order to run.
i.e. if I compile a program and send you the resultant exe file it may not work on your Windows PC. (Is that right?)
If so, how do games using OpenGL (based on C++) get around this? They need to produce a game that will run on any configuration of OS version and CPU.
i.e. if I was to write a program in C++ and try to sell it (hypothetically) how would I create an exe that can run on any Windows machine?
|
Fri Jan 14, 2011 1:14 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
Sort of You need any dependent dlls on the machine You can do, you just need to package it with all the files it needs to run if the user doesn't have them
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Fri Jan 14, 2011 1:44 pm |
|
 |
big_D
What's a life?
Joined: Thu Apr 23, 2009 8:25 pm Posts: 10691 Location: Bramsche
|
You need to re-target the code at compile time, to the specific architecture.
That usually means compiler switches to change the includes and branch compile different classes or methods in classes, which are architecture specific.
The core code will be the same, cross platform, but the UI and IO routines will generally need to be re-written for each platform (unless it is a plain command line routine) or you use a transportable toolkit, like qt.
_________________ "Do you know what this is? Hmm? No, I can see you do not. You have that vacant look in your eyes, which says hold my head to your ear, you will hear the sea!" - Londo Molari
Executive Producer No Agenda Show 246
|
Sat Jan 15, 2011 11:24 am |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
If anyone needs a programme that can test if a piece of text is palindromic then give me a call  Slowly but surely working through the text book! 
|
Mon Jan 24, 2011 11:20 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
something like that? (It might be a bit off, it's early and I just wrote that in the reply box direct)
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Tue Jan 25, 2011 8:06 am |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
A bit more than that. It has to standardise the text etc before hand... i.e. "eve" would return true in your program but "Eve" wouldn't. Also it's teaching stuff like algorithms and functions and locales so they've put all those in there too. Another one to test... "A man, a plan, a canal. Panama!" is also a palindrome but not according to your program 
|
Tue Jan 25, 2011 10:18 am |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
Yeah I just did it on a word, and I had just gotten up lol Simple-ish way in C#....
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Wed Jan 26, 2011 12:32 am |
|
|