Code::Blocks build errors

Thanks in advance for the help and patience.

I've just downloaded code blocks for Windows for the second time. The first time I successfully downloaded it and used it for the LazyFoo SDL tutorials, and then it quit working on me. Even super simple Hello World console applications wouldn't work. A search of the web told me redownloading might be necessary, which I preformed to no avail. If anyone has any advice, it'd be really appreciated.

I've included the contents of the build log for a hello world program:


-------------- Build: Debug in prayer (compiler: GNU GCC Compiler)---------------

mingw32-gcc.exe -LC:\SDL\SDL-1.2.15\lib -o bin\Debug\prayer.exe obj\Debug\main.o -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_ttf -
mingw32-gcc.exe: error: -E or -x required when input is from standard input
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))


1
2
3
4
5
6
7
8
9
10
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
just get visual studio 2013.
closed account (j3Rz8vqX)
Delete the last '-'

It should possibly be:
-lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_ttf

Not:
-lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_ttf -
Hi All
@salsa visual studio is good to start programming, but i think it should be expensive in the countries that have copy and write, myself in Iran, can Buy it with 5000 Tomans( 1.5 $), But really i don't like MS, So i prefer Linux(Ubuntu 13.10) and also i cant use Windows because of my work(Simulation 2D), and if you want to be a good Programmer, its better for you to start using Unix if you didn't start before. At all,
I don't have any idea for your Problem, I didn't see any inputs in your Code But in the error it said standard input!
one thing i think it will work is that:
remove using namespace std; and then wrote your program with std::, another thing is wrote a program and don't use any std objects, then post the log here.
thank you.
Have Nice Life
Thanks everyone :D

I should have noticed the extra hyphen... but what can you do. A second set of eyes is always appreciated! I had to use -lstdc++ as well to deal using the GCC compiler?

I took out -lstdc++ and wrote an uninteresting program with no std:: just in case @amirtork was interested... The following is the build log. Not a lot happens without -lstdc++.


-------------- Build: Debug in lasthope (compiler: GNU GCC Compiler)---------------

mingw32-gcc.exe -LC:\SDL\SDL-1.2.15\lib -o bin\Debug\lasthope.exe obj\Debug\main.o -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_ttf
obj\Debug\main.o: In function `_tcf_0':
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/include/c++/iostream:75: undefined reference to `std::ios_base::Init::~Init()'
obj\Debug\main.o: In function `_static_initialization_and_destruction_0':
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/include/c++/iostream:75: undefined reference to `std::ios_base::Init::Init()'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Topic archived. No new replies allowed.