My specs
OS: XP service pack 3 Professional.
Code::Blocks 10.05.
REV 6283
I keep on getting errors when trying to compile anything. at all even the basic hello world app..
||=== cppirc, Debug ===|
ld.exe||cannot find -lwxmsw29ud|
||=== Build finished: 1 errors, 0 warnings ===|
that one is for the minGW thing...
But there where other errors too.
Here is what im compiling on the hello world
C:\Documents and Settings\Chris\My Documents\CPPirc\cppIRC\main.cpp||In function 'int main()':|
C:\Documents and Settings\Chris\My Documents\CPPirc\cppIRC\main.cpp|8|error: 'cout' was not declared in this scope|
C:\Documents and Settings\Chris\My Documents\CPPirc\cppIRC\main.cpp|8|error: wrong type argument to unary minus|
C:\Documents and Settings\Chris\My Documents\CPPirc\cppIRC\main.cpp|9|error: expected ';' before 'return'|
||=== Build finished: 3 errors, 0 warnings ===|
#include <iostream>
#include <string>
#include <ctime>
int main()
{
cout <- "Hello World"
return 0;
}
It won't run at all.
Fix decide if you are going to do C or C++. I am guessing C++ because of cout.
Next, add the missing ";" after the cout line. And change "<-" to the correct symbol!
http://www.cplusplus.com/doc/tutorial/program_structure/
NOTE: This is not a site to learn programming!!
Tim S.
it still won't compile with that. i took that code out and left it with a return it would not compile. Ok if that was an error even if fixed it will not compile! Do not accuse me of it not compiling. its something wrong Not with the app. its some kind of settings i need help with. I am sure its settings. as i used the minGW compiler combo pack from here. Also tried installing the latest version which seems to not work!
Ld.exe fails to run properly within code blocks it is my guess
as a matter of fact here is the error again with it all fixed from that page
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
||=== cppirc, Debug ===|
ld.exe||cannot find -lwxmsw29ud|
||=== Build finished: 1 errors, 0 warnings ===|
Read here: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
doesn't help does not fix my problem
here is log by the way
QuoteBuild started on: 11-08-2010 at 14:57.11
Build ended on: 11-08-2010 at 14:57.12
-------------- Build: Debug in cppirc ---------------
mingw32-g++.exe -LC:\wxWidgets-2.9.1\lib\gcc_dll -L"C:\Documents and Settings\Chris\My Documents\Dev Packs (CodeBlocks)\lib" -o bin\Debug\cppirc.exe obj\Debug\main.o -mthreads -lwxmsw29ud -mwindows
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw29ud
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
Does the folder C:\wxWidgets-2.9.1\lib\gcc_dll contain the library wxmsw29ud?
If not, please fix the path, remove the library or compile the library if it is needed.
Note: I have no reason to believe your hello world requires wxWidgets 2.9 Unicode Debug Library. Do you?
Edit: Please learn the different between Compiler Errors, Linker errors, and Logic errors.
(I did not see any Logic Errors; but any big program tends to have a few till the program works right.)
In the long term this will help you a lot with programming in C.
Tim S.
I am gonna use this library for something. The startup came with that when i added my file :P so i tested the compile to see if it worked. and it did not even compile.. let me try setting up a regular app
EDIT:
It works with regular app how do i set up the WX lib thing then?
EDIT AGAIN:
here is log without the cout function
QuoteBuild started on: 11-08-2010 at 15:27.31
Build ended on: 11-08-2010 at 15:27.31
-------------- Build: Debug in cppirc ---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wno-attributes -Wall -g -D__WXDEBUG__ -IC:\wxWidgets-2.9.1\include -IC:\wxWidgets-2.9.1\contrib\include -IC:\wxWidgets-2.9.1\lib\gcc_dll\mswud -I"C:\Documents and Settings\Chris\My Documents\Dev Packs (CodeBlocks)\include" -c "C:\Documents and Settings\Chris\My Documents\CPPirc\cppIRC\main.cpp" -o obj\Debug\main.o
cc1plus.exe: error: unrecognized command line option "-Wno-attributes"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
ok wait i think the thing is not even compiled all i did was use the installer for wxWidgets...