Page 1 of 1

codelite wont let me compile and I dont know why

Posted: Thu Oct 25, 2012 6:05 pm
by shionoro
Hey, I hope you can help me here to bring my odyssey to an end.

I use codelite at university and all is fine when i am using their pc on which it was preinstalled.
However, i need it at home, too, andthus, i installed the latest version of codelite (v4.1.5770) and wanted to do what i did before.

I installed codelite in a folder called MinGW on my C drive, and then i started it and created a workspace called

name:test
path: C:\MinGW

and created it.

I then started a new project called 'test2', while i chose 'c++ kurs' (i think that one is only available in the version i got from the university page) and as compiler it had 'gnu g++'.

Then, i created a file called 'test3' and chose c++ source file.

I then wrote the program:
_____________________________
#include <iostream>
using namespace std;

int main() {
cout << "why do you hate me?\n";
return0;
}
______________________________

Then, i pressed f7 and got:

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe" -e -j 4 -f "test_wsp.mk""
----------Building project:[ test2 - Debug ]----------
mingw32-make.exe[1]: Entering directory `C:/MinGW/test/test2'
g++ -std=c++11 -Wall -Wno-unused-local-typedefs -c "C:/MinGW/test/test2/test3.cpp" -g -o ./Debug/test3.o -I"C:\MinGW"/include/c++ -I"C:\MinGW"/include/c++/Eigen -I. -I.
C:/MinGW/test/test2/test3.cpp: In function 'int main()':
C:/MinGW/test/test2/test3.cpp:6:2: error: 'return0' was not declared in this scope
return0;
^
mingw32-make.exe[1]: *** [Debug/test3.o] Error 1
test2.mk:86: recipe for target `Debug/test3.o' failed
mingw32-make.exe[1]: Leaving directory `C:/MinGW/test/test2'
mingw32-make.exe: *** [All] Error 2
test_wsp.mk:4: recipe for target `All' failed
----------Build Ended----------
0 errors, 0 warnings


I don't quite understand what i did wrong, but maybe you can tell me?
I am sitting on different versions of codelite since some hours on my latop with ubuntu, but this one i tried on windows 7 from my home pc.

Pls help me, i am very frustrated.

Also, as a second question:
When i compile stuff it wont tell me what or if i did anything wrong, like it does at the university pc (like, hey, u forgot } or those things, think it's called debugging)

I know my knowledge at pc's and programming is like that of a monkey, but it cannot be that hard to make it run, i hope? <:

Re: codelite wont let me compile and I dont know why

Posted: Thu Oct 25, 2012 6:40 pm
by eranif
First of all, codelite is not a compiler.
codelite *does* let you compile, you just need to learn to write a compilable code...

NOTE:
Please use code tags when posting code - its HARD to read what you post

g++ (again, g++ *not* codelite) is telling you that it does not understand what is "return0"
read the errors and fix your code.

I would recommend posting compilation errors in a c++ forum, for example:

http://www.cplusplus.com/forum/

Eran

Re: codelite wont let me compile and I dont know why

Posted: Thu Oct 25, 2012 8:27 pm
by shionoro
wow, yes, it was the missing space there.....sorry bout that, it was the tenth time i tipped in that program, before it would not work even though i wrote a correct prog.

However, not it does, thank you very much.