Error message, again

I just spent a long time trying to figure out a problem, and when i finally figured it out, i had to change the file from a .c to a .cpp, it gave me this new error message
mingw32-g++.exe: error: obj\Debug\Untitled1.o: No such file or directory

#include <iostream>

using namespace std;

int main()
    int mynumber;
    mynumber = 10;
    cout << mynumber << endl;
    return 0;

If someone could please help, thanks!
what compiler are you using? (not IDE)
GNU GCC Compiler.
closed account (3qX21hU5)
Your project setting are messed up because you changed the file. My advice if that is all that your program is just start over from scratch and make a new project.
I did that, and now i have this error message,
obj\Debug\main.o:C:/Users/David/Documents/C++/Variables/main.cpp:6: first defined here
collect2.exe: error: ld returned 1 exit status
Im confoused!
thats a linker error!

(i have that problem with something else right now in SDL :P)

you havnt installed your IDE properly, have you just installed it? some file is missing or summink.

Last edited on
What is that?
you a brand new coder? even though this took me forever to suss out and they never write enough about it,

the compiler knows how to crunch keywords into machine code, and it needs to know how to do that by knowing where all the source code is to do that, where it looks is the liker options, i didnt have to worry about this right away, unfortunatley you do, dont be put off though, this bit is hard and you dont normaly have to deal with it straight away

my problem right now is that im trying to add libraries and my linker doesnt know where they are, so it doesnt know what the keywords i popped in actually mean! so i get the same error you are!

this is hard to explain, we need one of the better coders to help you because this is my weakness
Last edited on
closed account (3qX21hU5)
Go into C:/Users/David/Documents/C++/Variables/ on your computer and list every file you see there for me please.
I never actually found anything on linkers and linker settings, if you find a good recourse please let me know
Those are all of the files
And yes, this is third day, spending the second day trying to figure this out. And i also just installed Code: :Blocks.
you get days like that, I remember there are tutorials on using for the first time, making sure you use the right compiler settings , are you using version 12.11??
Last edited on
closed account (3qX21hU5)
Just delete all them files so the Variables folder is nice and clean then try creating a new project in that folder.

If that doesn't work I would do a full reinstall of your compiler/IDE. It is most likely not a linker problem since the compiler should have set up all the linker setting for you automatically (Though it can mess up sometimes which is why a reinstall might help) and you haven't downloaded any libraries on your own i don't think.
Last edited on
yup version 12.11.
dude go to compiler go to settings go to toolchain executables, in the field C++ compiler in the program files tab do you have ming32-g++.exe?

what do you have ticked in compiler flags??
Last edited on
closed account (3qX21hU5)
Devon his compiler is working..... He is getting error messages where do you think they come from? ;p
Last edited on
I have this one mingw32-g++.exe, i dont what the flags are though
lol oh yeah, re install it, its being weird.
Topic archived. No new replies allowed.