Learning Codebench

3 posts / 0 new
Last post
jwanderson88
jwanderson88's picture
Offline
Last seen: 1 week 6 days ago
Joined: 2019-04-13 19:29
Learning Codebench

Hi, I'm trying to learn Codebench. It's going okay, I think. I jumped into the deep end and I'm working on a project that has eighteen source files and it least that many headers. I'm moving it over from Cubic IDE. Many of the files have errors, but everytime it compiles. it does every file, errors and all, before stopping. It takes a minute or two. I'm wondering if there is a way to get it to stop compiling after the first error to save time. Also, is there a way to get it to stop displaying routine messages like the ones about deprecated functions? Another problem I have is that it seems like the make clean function deletes some (maybe all) of my source files. I admit there is a lot that I don't understand yet.

Rigo
Rigo's picture
Offline
Last seen: 16 hours 15 min ago
Joined: 2011-01-24 21:55
Re: Learning Codebench

This isn't really a CodeBench problem, but I'll try and help as much as I can.

If your project compiled fine under Cubic but not CodeBench, I'm guessing you set CodeBench to automatically create the makefile for you, and this is where you may have lost some compiler switches. By default, CodeBench will add -Werror to the compiler switches. This means the compiler will stop on any error giving you a chance to fix it.

As for deprecated functions, the proper fix here is to not use them, they are deprecated for a reason. However, luckily GCC supports the -Wno-deprecated switch which will turn off all deprecated warnings. This should really be avoided though, as bugs may lurk underneath which could be masked by the use of this switch.

As for the "Clean" rule deleting your source files, again there appears to be an error in the makefile leading to .c files being deleted rather than the .o ones.

If you still have the original makefile you was using for Cubic, you can tell CodeBench to use that instead, and simply turn off the automatic makefile creation.

Hope this helps somewhat. Keep coding, it's worth it in the end.

Simon

salass00
salass00's picture
Offline
Last seen: 3 days 4 hours ago
Joined: 2011-02-03 11:27
Re: Learning Codebench

@jwanderson88

If the makefile that you're using has the source code files (*.c/*.cpp) listed in OBJS (or whatever its equivalent variable is called) instead of object (*.o) files then that could explain why all files are compiled every time and why the clean rule deletes the source code files instead of any object files.

Log in or register to post comments