User forums > Help
Examples
stahta01:
--- Quote from: ukimiku on December 03, 2009, 04:25:14 pm ---Morten,
thank you. That was really over-obvious.
Anyhow, I ran into the problem that I, when attempting to compile even the tiniest Hello World sample, received a "...invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!].. skipping..." message. Turned out there were two MINGW directories, one with gcc 4.4.0, one with 3.4.5. Setting the latter as default finally worked.
Now, anytime I create a new project with a console app and compile the program for the first time, the "Hello World" does not appear. Instead, the console window comes up, empty. I then close the console. When I compile the app again, the "Hello World" appears, the process terminates gracefully (exit code 0). Do you happen to know why I have to compile everything twice before it works?
Regards
--- End quote ---
NOTE: If you have two MinGW Installation; neither can be in C:\MinGW this folder is hard coded in some of the search paths.
Tim S.
ukimiku:
Tim,
thanks for replying. Yet I don't understand exactly what you are pointing at. I have two installations, and I changed both the Windows system PATH environment variable and the paths in the Code::Blocks application so that they now point to my preferred installation of MINGW. In fact, the program compiles and runs. So it would seem to me that you can choose any folder. Otherwise, what would be the use of being able to change the path to your installation in the configuration preferences, I wonder? Am I mistaken? In which search paths is "MINGW" hard-coded? Why should it be?
Thanks & regards!
ukimiku:
--- Quote from: MortenMacFly on December 03, 2009, 04:34:47 pm ---
--- Quote from: ukimiku on December 03, 2009, 04:25:14 pm ---Do you happen to know why I have to compile everything twice before it works?
--- End quote ---
To be honest: No. :( I never experienced such.
--- End quote ---
Morten, could it be that on Windows Vista, the usual console template fails to flush the output buffer? That would explain why I can't see any "Hello World" the first time I run the program. What do you think? I'm a novice at C++ and wouldn't know how to test whether my assumption is correct.
Regards
Jenna:
I have a Vista installation on a virtual machine and it works fine here.
I use TDM's MinGW 4.4 and a selfbuild C::B.
The 8.02 release has an issue with the path set in the compiler-options. It uses the executables, that come first in the systems search-path, newer versions (aka nightly builds) always put the configured path in front of the systems search path.
Dou you use C::B as normal user or do you have administration rights ?
If you have multiple installations of MinGW in the searchpath, you might get problems if one of them lacks some executables and the files of the other installation are used.
Did you try to use a nightly-build and a clean installation of TDM's gcc 4.4 (and no other MinGW on your system), that is known to work correctly with Vista ?
nightlies: http://forums.codeblocks.org/index.php/board,20.0.html
TDM's gcc: http://tdragon.net/recentgcc/
MortenMacFly:
--- Quote from: ukimiku on December 03, 2009, 10:33:23 pm ---Morten, could it be that on Windows Vista, the usual console template fails to flush the output buffer?
--- End quote ---
Note sure what you mean by "termplate", but the console that opens when running the compiled "Hello World" executable shows everything. When the application terminates all buffers are flushed. Always. The reason is simple: They would not be available anmore otherwise after destruction... ;-).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version