Hey guys
I got a problem. I compiled programs with CB for about 3 years. Everthing worked fine and without troubles. Than I updated it to the last version and I can't run my compiled exe files anymore. Not even a simple "Hello World" works. If I run the program with CB it works but if i run the exe file it just pops up for some milisecounds and nothing more happens. What did I wrong ???
code?
what about executing it from cmd/terminal?
With cmd its the same.
Code is a simple Hello world exe.
#include <stdio.h>
int main(void)
{
printf("Hallo world");
return 0;
}
Quote from: Trafficjunky on July 12, 2013, 07:29:34 PM
With cmd its the same.
Code is a simple Hello world exe.
#include <stdio.h>
int main(void)
{
printf("Hallo world");
return 0;
}
what means the same? it prints Hello World and quits?
I dont know if it does its to fast^^ how i wrote its just for a few milisecounds on the screen
Put one getchar(); before the return statement and it will "work"...
I allready tried getch(); scanf(); delay(); and system("pause"); ... nope
if you execute it in the cmd it wont flash away... the cmd will stay open... If not you will get some segfault error...
please rebuild and post the !full! build log
greetings
Checking for existence: C:\Users\-\Documents\HalloWorld\bin\Release\HalloWorld.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Users\-\Documents\HalloWorld\bin\Release\HalloWorld.exe" (in C:\Users\-\Documents\HalloWorld\.)
Process terminated with status 0 (0 minutes, 1 seconds)
Quote from: BlueHazzard on July 12, 2013, 08:06:46 PM
if you execute it in the cmd it wont flash away... the cmd will stay open... If not you will get some segfault error...
please rebuild and post the !full! build log
greetings
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
oh sry
-------------- Clean: Release in HalloWorld (compiler: GNU GCC Compiler)---------------
Cleaned "HalloWorld - Release"
-------------- Build: Release in HalloWorld (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -O2 -Wextra -IC:\SDL\SDL-1.2.13\include -IC:\SDL\SDL_image-1.2.12\include -IC:\Users\-\Documents\SDLmenu\lib -IC:\Users\-\Documents\SDLmenu\include -c C:\Users\-\Documents\HalloWorld\main.cpp -o obj\Release\main.o
mingw32-g++.exe -LC:\SDL\SDL-1.2.13\lib -LC:\SDL\SDL_image-1.2.12\lib -LC:\Users\-\Documents\SDLmenu\lib -o bin\Release\HalloWorld.exe obj\Release\main.o -s -lmingw32 -lSDLmain -lSDL "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSDLmain.a" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL.dll.a" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libmingw32.a" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\SDL_image.lib" "C:\Program Files (x86)\CodeBlocks\MinGW\lib\libwinmm.a"
Output size is 9.50 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
is that what you are looking for?
Get rid of all the SDL stuff and maybe a simple "Hello World" will work!
1. Remove all the SDL from the Project Compiler/Linker Settings.
2. Remove all the SDL from the Global Compiler/Linker Settings.
Tim S.
no didn't ...
-------------- Clean: Release in HalloWorld (compiler: GNU GCC Compiler)---------------
Cleaned "HalloWorld - Release"
-------------- Build: Release in HalloWorld (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -O2 -Wextra -c C:\Users\-\Documents\HalloWorld\main.cpp -o obj\Release\main.o
mingw32-g++.exe -o bin\Release\HalloWorld.exe obj\Release\main.o -s
Output size is 9.50 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
Compile and Link an EXE from the command line, does it work?
If yes, post the commands you used on the command line.
(Likely a CB toolchain setting issue)
If no, your Compiler has an issues?
Tim S.
Okay I thank you all! Just found the problem. I've installed MinGW twice and CB's auto search took the false one. Now everything works like it did before.