Author Topic: Big question!!  (Read 6119 times)

Offline kecho

  • Single posting newcomer
  • *
  • Posts: 6
Big question!!
« on: March 18, 2008, 03:28:17 pm »
Is there any way of porting messages from the command prompt to C::B ?? every time I compile i never get the errors... only if the build failed in the message box...

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Big question!!
« Reply #1 on: March 18, 2008, 05:18:34 pm »
Is there any way of porting messages from the command prompt to C::B ?? every time I compile i never get the errors... only if the build failed in the message box...

Hi, kecho.

The complete output is shown in a window titled "Build log" and a summary is in another window titled "Build messages".

If you don't see these, go to the view menu and make sure "Logs" is checked.

Offline kecho

  • Single posting newcomer
  • *
  • Posts: 6
Re: Big question!!
« Reply #2 on: March 19, 2008, 05:15:16 pm »
well yes perhaps I should have been more specific. Say I have a project named "test", which has the file main.c
the content is:
Code
#include <stdio.h>
int main ()
{
    printf("hello world ")
    return 0;
}


Whenever I compile using djgpp in the command prompt I get:

Code
c:\>GCC.EXE -Wall  -g    -IC:\DJGPP\BIN  -c C:\dos\test\main.c -o obj\Debug\main.o
C:\dos\test\main.c: In function 'main':
C:\dos\test\main.c:6: error: expected ';' before '}' token
C:\dos\test\main.c:6: warning: control reaches end of non-void function
c:\>_

but when doing it in c::b I get this in the message box:

Code

-------------- Build: Debug in test ---------------

GCC.EXE -Wall  -g    -IC:\DJGPP\BIN  -c C:\dos\test\main.c -o obj\Debug\main.o
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings


Yes I know c::b, there is an error in my code! but where ??

As you can see, c::b doesn't show me explicitly where and what errors do I have, I was hoping that there is a window or something like in Visual Studio that would let me see exactly in what line is the semicolon missing (I have projects about thousand of lines of code and it will be no fun to look out where is the semicolon missing or where i forgot a parenthesis ;) )

If not I guess the solution will be keep using the command prompt... which is what I don't want :D

hope you guys can help, thanks!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Big question!!
« Reply #3 on: March 19, 2008, 06:03:52 pm »
If you use the posted code in C::B you should have the same error.
I can't compile it without errors.

It's exactly what the compiler says: you're missing a semicolon.
The first line in main-function is the problem.

By the way that's not a real C::B specific question.

Offline kecho

  • Single posting newcomer
  • *
  • Posts: 6
Re: Big question!!
« Reply #4 on: March 19, 2008, 06:13:16 pm »
If you use the posted code in C::B you should have the same error.
I can't compile it without errors.

It's exactly what the compiler says: you're missing a semicolon.
The first line in main-function is the problem.

By the way that's not a real C::B specific question.

Apparently you didn't get my point and your language semantics are confusing me. Perhaps your message window in your C::B displays the line and where the error occurs, but my C::B message window doesn't. It must be a configuration problem but I can't find where to fix that. And yes its a specific C::B question, I posted the code as a simple example so anyone can get my point and apparently you didn't.

Quote
If you use the posted code in C::B you should have the same error.

But i don't get the same error! and that's the whole point of this topic, and no the answer is not "you should have the same error".

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Big question!!
« Reply #5 on: March 19, 2008, 07:41:12 pm »
I am guessing that you do not have the compiler configuration right.

Please verify the path to GCC.EXE is set correctly in the compiler configuration.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Big question!!
« Reply #6 on: March 20, 2008, 12:10:40 am »
I fail to reproduce your error also.  The steps I perform was:

1. open codeblocks
2. file -> new -> file...
3. C/C++ Source File
4. save file as 'main.c' on my desktop
5. copy/paste code exactly as you stated
Code
#include <stdio.h>
int main ()
{
    printf("hello world ")
    return 0;
}
6. click  Build



Build Log tab displays:
Code
Compiling: C:\Documents and Settings\Owner\Desktop\main.c
C:\Documents and Settings\Owner\Desktop\main.c: In function `int main()':
C:\Documents and Settings\Owner\Desktop\main.c:5: error: expected `;' before "return"
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings


Build Messages tab displays:
Code
C:\Documents and Settings\Owner\Desktop\main.c      In function `int main()':
C:\Documents and Settings\Owner\Desktop\main.c 5   error: expected `;' before "return"
=== Build finished: 1 errors, 0 warnings ===

EXACT same results if i go ahead and make a proper project first instead of compiling an orphan file. 

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Big question!!
« Reply #7 on: March 20, 2008, 12:25:06 am »
If I remember right from an other post, you are using C::B 8.02 after upgrading from an older version (svn41xx I guess).

Have you tried to completely delete the old installation (or move it away) and delete (or move) the codeblocks settings in "c:\Documents and Settings\<username>\Apllication data\codeblocks" ?

Before you do so you should make a backup of "default.conf" and perhaps other .ini-files (cbKeyBinder...) and of course before deleting the whole directory you have to first uninstall C::B 8.02 to not mess up the installer.

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: Big question!!
« Reply #8 on: March 20, 2008, 04:38:05 pm »
But i don't get the same error! and that's the whole point of this topic, and no the answer is not "you should have the same error".

Try cleaning the project object files by Build->Clean, then Build (Ctrl-F9) your code on debug target, and look the build messages and build log. Some times that kind of problem happened to me and is difficult to reproduce. It's if something is not updating on your compilation, but switching to debug target and cleaning the object files point me to the line where was the error.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 797
Re: Big question!!
« Reply #9 on: March 20, 2008, 07:36:40 pm »
First : is your djgpp compiler is fully supported by C::B ? Not sure ! It's not in the wiki list.
Secondly : try a search in the forum with djgpp as keyword. It seems that other guys have the same problem with this compiler (may be solved !)

gd_on
« Last Edit: March 20, 2008, 07:49:27 pm by gd_on »
Windows 11 64 bits (23H2), svn C::B (last version or almost!), wxWidgets 3.2.4 (tests with 3.3), Msys2 Compilers 13.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline kecho

  • Single posting newcomer
  • *
  • Posts: 6
Re: Big question!!
« Reply #10 on: March 21, 2008, 05:33:03 pm »
This looks like a bug of Code::blocks with djgpp. If I use another compiler such as mingw32-gcc.exe the error will be displayed just like my friend Seronis has over his machine:

Quote
Compiling: C:\Documents and Settings\Owner\Desktop\main.c
C:\Documents and Settings\Owner\Desktop\main.c: In function `int main()':
C:\Documents and Settings\Owner\Desktop\main.c:5: error: expected `;' before "return"
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings

however when switching from this compiler to DJGPP i get:

Quote
Compiling: C:\Documents and Settings\Owner\Desktop\main.c
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

And later, thanks to gd_on, I discovered that this was a filed bug in C::B nightly builds

http://developer.berlios.de/bugs/?func=detailbug&bug_id=11586&group_id=5358
http://forums.codeblocks.org/index.php/topic,6470.0.html

Ive tried reinstalling cleaning the register from old C::B versions and the results are the same. This might be a persistent bug that developers didn't look over in version 8.02 or my incompetence in configuring this compiler. Please let me know what you guys think.

~K.