Archive for the 'Technology' Category

Unicode Support in Code::Blocks

Biplab October 26th, 2007

Code::Blocks (C::B) had a long known problem of crashing / locking up while an accented character is used in the code. Or even worse when the encoding of a file is changed from one encoding to another. It was able to support upto UTF-8 encoding with occasional lock-up.

I started working on this around 2-3 months back. But during testing we found that C::B still hangs and it is due to Code-Completion (CC) plugin. The issue was due to the presence of some ANSI functions in Code-Completion parser. Morten then started his work to fix this. It almost resulted to a small re-write of Code-Completion. And we could finally test our Unicode changes with CC enabled.

We tested it for couple of weeks before we found it to be stable enough for further real-life testing by our users. In revision 4548, the first collection of patches were committed (including Morten’s patch on CC). Few users posted some issues which were then quickly resolved. As of writing, the code seems to be quite stable.

So what are the changes that have been made??

There were a number of changes that has been made.

  1. Encoding detection code has been improved by using a portion of MadEdit’s encoding detection code. Currently it can detect, UTF-8, UTF-16 BE/LE, UTF-32 BE/LE with/without BOM. The fall back code has been kept to ANSI (CP-1252 on Windows).
  2. Encoding conversion routine has been overhauled. Now it converts back and forth all supported encodings flawlessly.
  3. Now all the encoding detection and conversion code is much more efficient as it involves minimum disk reads and most of the operation is done in memory buffers (Thanks Thomas for keeping this strict criteria).
  4. The file load routine has been moved from a all in one load-plus-encoding detection code to efficiently distributed code.
  5. File save routine was overhauled to save files with all supported encodings.
  6. Project load routine has been tweaked to reduce the stalling while opening a large project with a large number of open files in it.
  7. Morten made CC parser Unicode compliant so that it can now parse any files without a single lock-up.

I would request users to use Build Revision 4553 onwards to get the most benefit out of it. Please post any related issues in the forum itself. :)

Code::Blocks August-September Month Update Summary

Biplab October 14th, 2007

As usual the update summary is full of new changes made to Code::Blocks and lot of bug fixes.

Summary:

  • Help plugin now supports browsing of Man pages.
  • wxSmith got number of new features including support to visually edit layouts, add events, etc.
  • Support for generated source files in build system.
  • Few critical bugs have been fixed. This included a well known DDE bug, crash at close bug, project file corruption in some cases bug, etc.

Please note that the following changelog is based on SVN commit history of past two months. Detailed and organised changelog is as follows. Continue Reading »

Save Bandwidth – Download Delta-ISO

Biplab August 15th, 2007

If you love to try latest GNU/Linux distributions then you may save yourself from downloading full Linux ISO everytime a new version has released. As the Linux ISOs are large in size, downloading them burns a huge amount of bandwidth both for the publisher and the end-user.

Couple of GNU/Linux distributors including OpenSUSE, Sabayon have started publishing Delta-ISO. This is basically an ISO file containing only the additions/updates/changes with respect to an old version. It contains binary diff of all the distributed packages. Thus the ISO is smaller to download.

On 9th August, 2007 OpenSUSE-10.3 Beta 1 was released. In the next few paragraphs, you’ll learn to convert the delta-iso to a full iso. I had downloaded OpenSUSE-10.3 Alpha 7 iso (openSUSE-10.3-Alpha7-GNOME-i386.iso) earlier. To create a New ISO of OpenSUSE-10.3-Beta 1, we need a delta ISO. Now browse to the following folder in any OpenSUSE mirror and download the appropriate delta iso.

/pub/opensuse/distribution/10.3-Alpha7/iso/delta/

For me, openSUSE-10.3-Alpha7_Beta1-GNOME-i386.delta.iso, is the appropriate one.

Now download applydeltaiso utility (for Windows). Then in the command line issue the following command. There’s a bare minimum GUI of applydeltaiso utility at the same link. You may wish to use the graphical utility, too.

applydeltaiso openSUSE-10.3-Alpha7-GNOME-i386.iso
              openSUSE-10.3-Alpha7_Beta1-GNOME-i386.delta.iso
              openSUSE-10.3-Beta1-GNOME-i386.delta.iso

Voila!! After 5-10 minutes (depending upon your hard-disc speed) you’ll get a new ISO by downloading just 189 MB of data!!

But please keep the following points in mind.

  1. Your hard disc should have enough space to create the new iso.
  2. If you are using FAT32, then 2GB limit will be applicable to you.
  3. Don’t forget to verify the new ISO by comparing it’s MD5 checksum with the one published by publisher (in this case OpenSUSE).

So keep enjoying latest changes in GNU/Linux world!

Code::Blocks July Month Update Summary

Biplab August 10th, 2007

After another month long development of Code::Blocks (C::B) by the C::B Dev Team (including me), we made the following modification / improvements. Apart from adding couple of newer features we’ve fixed a number of annoying bugs, improved the stability and usability of it.

The following changelog is based on SVN Commit History of July 2007. Please note that this is not a Release Announcement and the changelog contains the commit made by entire C::B Dev Team in July 2007.

BTW, C::B has not won the SourceForge.net 2007 Community Choice Award as a Best Tool or Utility for Developers. I would like to thank you all on behalf of C::B team for supporting & voting us and putting us in the final list.

Summary

  • Added support for additional resource files to be added in resource package. This means now plugins can freely install extra icons and other resource files to the share folder of C::B.
  • Added support for version detection of compilers during runtime. This is currently used for GCC (MinGW) compiler. This adds the possibility to detect a compiler version and appropriately turn off incompatible/deprecated compiler options between versions.
  • Code-completion got a number of updates. It’s parser received some long-demanded updates and fixes.
  • Added support for Tooltips of variable, objects in the editor.
  • Project import code has been moved from SDK to a new plugin “Projects Importer”.
  • Added support for Remote Debugging.

Detailed changelog is as follows. Continue Reading »

Code::Blocks May Month Update

Biplab June 7th, 2007

Here is the changes made to Code::Blocks during May month.

Most of our time last month were dedicated for bug-fixing. In fact, whole May month was, virtually, declared as bug-fix month.

As reiterated earlier, this is Not an Official Release Announcement. The following list is based on the commit history.

Notable fixes/improvements:
————————–
* A lot of Compiler warnings were fixed which pop-ed up after switching nightlies to wxWidgets-2.8.x
* Notebooks were restored in Compiler and Project Options dialogs.
* Editor settings dialog will not fill the entire screen.
* Static lib target name generation has been updated.
* Open project link in Start page will now behave correctly.
* Added support for Turbo C++ Explorer’s compiler, WinAVR compiler.
* AStyle plugin has been updated with AStyle 1.20.2.
* A lot of fixes were applied in CodeSnippets plugin.
* wxGrid has been added to wxSmith plugin and a number of bugs were fixed in wxSmith.

Detailed change log is as follows. Continue Reading »

Code::Blocks and wxWidgets 2.8.4

Biplab May 25th, 2007

wxWidgets (wx) 2.8.4 has been released recently. Since Code::Blocks was switched to wx 2.8.x series wx-2.8.3 runtime dll was being used on Windows. But wx 2.8.3 had some serious issues which were crippling some of the features of Code::Blocks on Windows and as well as on Linux. Well let me explain them.

On Windows, the pop-up menu were not responding to clicks. This became an annoying issue for Code::Blocks as a major portion of pop-up menus were not working. This bug existed in wx-2.8.3 and has been fixed in wx-2.8.4.

So if you are facing such issue where the Pop-Up menus are not working, just upgrade to wx-2.8.4. A link to a new DLL is now available with the Nightly Build links. Please check the Code::Blocks forum for the link.

On Linux the issue was quite serious, though. There is a bug in wx-2.8.3 in which an application may run into an endless loop if a statictext control is added to menu. This issue was making Code::Blocks to hang-at-start-up. So if your Code::Blocks installation is showing such weird behaviour, it’s time to upgrade.

For Linux, you need to upgrade on your own. As such no wxGTK runtime will be provided by Code::Blocks team (including me). You may build it on your own or can check wxWidgets website’s Download section.

So if you face any of these two issues, please don’t file a bug-report. Rather update wxWidgets runtime.

Signing off today. :)

wxWidgets Wizard Update: Apr 2007

Biplab May 4th, 2007

Hello all,

The wxWidgets Wizard of Code::Blocks have been updatd recently. In this article I’ll explain the changes that I’ve committed.

Earlier wizard had two pages to add additional libraries in Non-Monolithic build of wxWidgets in Windows. Now those two pages have been changed to a more user-friendly one page list. All the libraries are now available as a single list and selecting them is also easier. Please see the following screenshot for more details.

wxaddllibpage.png

Another important update has been committed in the wizard. Wizard is now able to add additional dependencies if you’ve forgot to add them in your project. This would be helpful in resolving linking errors due to missing dependencies.

In past couple of months, several users requested to add support for a wxWidgets target addition. In this update I’ve added that, too. Now you’ll be able to add a target to an existing project even with a different compiler and configuration.

To use this, please click File > New > Build target menu. Now you’ll see the following screen.

wxintarget.png

Select wxWidgets from the list and the target wizard will start. Now follow the steps in the wizard and use appropriate settings. The wizard will create a New target for you.

Please note that to add a new target, a project should be open in Code::Blocks.

Hopefully you’ll find this new addition to be useful.

Regards,

Biplab

wxWidgets 2.6.4: New Release with New Issues

Biplab April 12th, 2007

Hi All,

Posting after a long time. Got busy with studies and coding.

Last month wxWidgets-2.6.4 was released. This is primarily a bug-fix release. Though newer releases are already available, a number of projects are still using wxWidgets 2.6.x for their projects. Code::Blocks is one such example.

Since it’s release I’ve been compiling Code::Blocks with it to find out any issues. The first issue that I noticed was incorrect File-type icons in Code::Blocks. All the icons that C::B associates with different file types were getting mangled after I compiled it with wxWidgets-2.6.4.

Finally the bug has been found out and the fix is pretty easy. Just apply the following patch to wx.rc file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- C:/wxWidgets-2.6.4/include/wx/msw/wx.rc	Mon Mar 26 18:15:59 2007
 
+++ C:/wxWidgets-2.6.4/include/wx/msw/wx.rc	Mon Mar 26 18:17:13 2007
 
@@ -79,7 +79,7 @@// Low alphabetically to make it the default, but not so low as to
 
// affect applications that use 'a'
 
-bICON                           ICON "wx/msw/std.ico"
 
+//bICON                           ICON "wx/msw/std.ico"
 
//////////////////////////////////////////////////////////////////////////////
 
//

With this new wx code, an additional Icon was getting inserted into the exe file which was screwing up the associated icons.

Is it reported to wx-dev team? Answer is No and not necessary. This bug has been fixed in wx 2.8.x code. But unfortunately, the buggy code came with wxWidgets 2.6.4.

So if you want to compile Code::Blocks or any other app with wxWidgets 2.6.4, then please pay attention to this bug. Or otherwise it may haunt you for no reasons.

Another bug that has been noticed in Code::Blocks after switching to wx 2.6.4 is that it’s Find and Replace dialogs are now not responding to Escape key!

This bug is new and still not confirmed whether it’s an issue with wxWidgets 2.6.4 or Code::Blocks code. As far as I’m concerned, I’m quite sure that C::B code is not responsible for this.

I’m presently working on this to see if this can be fixed or not.

Hope this unofficial bug report and it’s fix will help you. :)

How to Install Code::Blocks Nightly on Windows?

Biplab March 26th, 2007

Hi Everybody,

In this article I’ll discuss on how to install Code::Blocks Nightly on Windows. Most of the Code::Blocks (C::B) users start downloading Code::Blocks RC2, which was the last stable release. But RC2 is very old, around one and half years old. A lot of changes were made to the core and that is one of the reasons of not releasing another stable release within this period.

First download a latest nightly from the following forum. Go to that forum and you’ll find a number of posts. Read the most recent release announcement.

http://forums.codeblocks.org/index.php/board,20.0.html

Code::Blocks nightly release file name will be in the following format. Generally you’ll find a file named CB_YYYYMMDD_revXXXX_win32.7z, where ‘X’ denotes revision number. Download this file.

Now extract the contents of this file to a folder. Please remember the following two points.

  1. Do not overwrite the contents of an existing Nightly or an older RC2 release installation directory contents. This may land you into troubles. There are major differences between RC2 core and latest Nightly core and they are incompatible with each other. If you overwrite an existing nightly,C::B may refuse to run if there is any changes made to the core and some plugins may fail.
  2. Before installing any C::B nightly, please remove older RC2 installation. Because the older RC2 created configuration files will conflict with newer ones.

Now Code::Blocks needs another two files to run. Both the files are also posted with each nightly releases. One file is wxWidgets runtime dll and the second one is MinGW runtime dll file. Download them and extract to the folder where codeblocks.exe file resides. These runtime files can be downloaded from the following link.

Your Code::Blocks nightly is now installed!!

If you still have any questions, please feel free to ask me. :)

wxWidgets, OpenWatcom and Code::Blocks

Biplab March 7th, 2007

Hello Everybody,

This week I’m posting wxWidgets Wizard update alongwith a number of other feature improvements that has been added in Code::Blocks.

A number of users had complained about the support of OpenWatcom in Code::Blocks. The support was there but it was broken as it was written quite a while ago. Thus I rewrote some of the parts to improve the support. Now it has been tested with OpenWatcom 1.6 and found to be working perfectly with different types of projects.

After improving OpenWatcom support the goal was set to make the wxWidgets Wizard compatible with OpenWatcom. It has been updated to work with latest OpenWatcom release. I’ve personally tested it with OpenWatcom 1.6 and found to be working perfectly. OpenWatcom support for wxWidgets Wizard has been added in Revision 3660.

Till date if anyone wishes to develop wxWidgets based application with OpenWatcom makefile was the only option. Latest Nightlies of Code::Blocks have changed the equation. The OpenWatcom support is also available in 3rd-Party GUI builder integration part of wxWidgets Wizard.

One feature is presently lacking in OpenWatcom support in wizard. It does not support PCH files. But soon this limitation will be resolved.

Another interesting feature addition to wizard is support for wxSmith, the default GUI builder in Code::Blocks. I’m thankful to Byo for his support making the integration possible.

I hope you’ll all find the latest changes more interesting and useful.

Thanks for visiting the Blog. Please visit again for more updates. :)

Next »