Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   programming outside the compiler (http://www.programmingforums.org/showthread.php?t=10108)

TwilightProgrammers May 31st, 2006 8:19 PM

programming outside the compiler
 
i was wondering how to make the program out of the compiler, so you wouldn't need the compiler to run it.
thanks for you help,


Also if you could answer this question too, How do you use c++ out of the Compiler with windows, some people tell me i should try to make a port scanner but i really don't know what to do to get out of the compiler, i know you need to use a for loop to do it, but i really don't know the windows part, so thanks i guess.

jayme May 31st, 2006 8:52 PM

It doesn't sound like you have a clue what a compiler is for. A compiler compiles(obviously) your code into an exe format file. You don't need a compiler to run a program, you need a compiler to compile. It's that simple.

As for your second question, I really don't know what you mean.

Conclusion: Read a bit about compilers, how they work, etc. If you don't know how to program in C++, then go learn before trying to make a port scanner. Maybe I'm wrong, but with these kinds of questions, it doesn't sound like you've ever compiled a program before, restricting your abilities to program port scanners.

TwilightProgrammers May 31st, 2006 8:59 PM

hmm, i use my borland turbo c++ v. 4.5 and i run programs. Lol and i just figured out how to run the program out of it.(please excuse my noobishness)

For the second part now, i was wondering how i get my Compiled program in a Windows Format...
thanks...

coder0xff May 31st, 2006 10:41 PM

I have never used borland compilers, but I can tell you this. You will need a compiler that can build win32 PE (portable executable) files. You don't have to purchase anything (but you can if you want). You can search google for "Win32 compiler" and should get plenty of results. You will also need to get header files that declare/define all the stuff you will need for windows. MinGW is an example. You will then need to make your compiler link to the necessary library that windows provides, such as user32.dll. This is the free (and legal) way to do it. You can also use borland (one of the versions that supports windows PE ofcourse), or a microsoft product (ie. Visual Studio, which you can currently get a free version of Visual C++ Express). There are many different ways you can make a windows application (and I am just talking C++ right now), too. There is first, plain win32 programming. But higher level options exist like MFC, .net (both from micro$oft), etc. Hope that helps

Prm753 May 31st, 2006 10:41 PM

Please, please stick with learning how to make console programs before you even think of trying to learn Windows programming.

msk420 May 31st, 2006 11:33 PM

Newb...

TwilightProgrammers Jun 1st, 2006 6:36 AM

thank you coder0xff for you help, and prm753, i just wanted to know how to do it, i really don't want to make gamming codes.

DaWei Jun 1st, 2006 7:03 AM

Generally speaking, a "Hello, World" program teaches you nothing about how programs work (and very little about programming). In C/C++, the source file that you write is subjected to at least three different processes. All preprocessor directives (statements beginning with #) are expanded by the preprocessor. The result of this, plus what you wrote, becomes the material submitted to the compiler. The compiler emits a certain amount of object code which is (usually) incomplete, but forms the nucleus of the program, which usually then needs to be combined with code written by others (library code). "Cout" is not just a word, it's a ton of code YOU didn't write. The linker then takes over and patches all these pieces together with the appropriate addresses. Sometimes (on some systems) this can result in directly executable code. On most machines you encounter in your early days, it results in code that can be placed somewhere in memory by the executive, polished off with actual addresses, and executed. Memory mapping from virtual to physical addresses may play a part, depending upon the system and the OS. All this still leaves a lot up to the coder, who should make at least a cursory study of how things work, as well as learning the syntax of the language and the methodology of programming. All this requires an investment on the part of the would-be programmer. The ability is not gained via osmosis.

Not all languages are compiled. Some are interpreted on the fly and others have an intermediate step involving so-called 'byte code'. Do a certain amount of homework and consider carefully what you want to ask. The results will be much more effective.

bl00dninja Jun 1st, 2006 7:25 PM

from your initial question, i would have said "write it down on paper, that way your compiler can't touch it"???????????

do you mean using a generic text editor to write programs and compiling them on the command line, or...???

ok, i just read the post again. you want to make an executable file. your borland compiler should create a file called "whatever the fuck you named your program".exe in the .bin folder or somewhere. you can run the program then from there. you can find the directory it's in, copy and paste to your desktop, and double click it there and it will run. or from the original folder. it is already compatible with windows. your IDE or compiler has already done what you wanted, it's just hidden in a file somewhere.

Ooble Jun 4th, 2006 6:21 PM

While we're on the topic of compilers, I thought I'd mention that Turbo C++ 4.5 is ancient. It's available from the Borland Museum for a reason. If you don't want to pay for a compiler, I would recommend Visual C++ 2005, Dev-C++ or Code::Blocks.


All times are GMT -5. The time now is 8:08 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC