You are not logged in.
Pages: 1
Hello you will have to excuse me Im really a beginner at programming.
I bought a book about programming C++, but in the examples given in the book the program are runned as .exe files.
How do I manage to solve this problem when Im sitting on an linux machine.
Is the only way to run a virtual desktop with windows to test the programs or what?
Thanks in advance!
Last edited by neuwerld (2009-05-06 19:42:47)
Offline
unless the examples use windows-specific code (directx,windows forms,etc) they will compile and run fine on linux.
you will probably want to use an IDE ( analog to visual studio on windows), personally i like codeblocks. a bit of googling should help you out
Last edited by schuay (2009-05-06 17:39:48)
Offline
The '*.exe' files are known as 'windows executables' which run natively on windows;
and you can run them in linux (the most of them) by installing wine and running the command wine <sample.exe>
You can compile the examples in that book in linux too.
Just use the "gcc/g++" tool and then execute the files into the terminal (as usual).
You can also compile (create) windows executables by using the "mingw32-gcc" tool.
Last edited by quarkup (2009-05-06 19:48:07)
If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.
Offline
Thanks for all the help I will try them out!
I may have been taken water over my head with this
Offline
On linux, you would do something like g++ -o myprogram myprogram.cpp
If the program compiles successfully you would end up with 'myprogram' in your current directory.
To run this you'd type ./myprogram
The -o flag to g++ tells it what to name the resulting executable. If you leave this out, it defaults to a.out.
Don't assume you're in over your head yet! There is a steep learning curve when it comes to learning your first one or two programming languages. I'd suggest looking up some basic C++ on linux tutorials to get you over the initial differences between programming on linux and what you'll read in the book.
Last edited by dmartins (2009-05-07 02:18:53)
Offline
I am a happy user of Geany - A fast lightweight IDE and text editor with syntax.
Offline
But beware functions and header libraries that are windows specific, thats the only prob with some c++ books is they don't cover much into how to do some things in linux or IF you hvae linux do this or use this as recommended etc.
Offline
Pages: 1