How to open multiple buffers in JEdit like in GEdit or Mousepad

Many of us use a text editor to edit program code. The simplest and clean edit is GEdit on the Gnome desktop. However, if you are not on the Gnome desktop, you may miss it. You can use JEdit which is much more powerful, however, by default, it does not open multiple programs alongside each . . . → Read More: How to open multiple buffers in JEdit like in GEdit or Mousepad

Use Code::Blocks with wxWidgets

# yum install gcc-c++

# yum install wxGTK-devel.x86_64 # yum install codeblocks codeblocks-contrib You will also get the GUI builder wxSmith.

# cd /usr/include # ln -sv wx-2.8/wx wx # Now run the default project it opens

If you get fatal error: wx/setup.h: No such file or directory, add the line: `wx-config –cflags` in Settings . . . → Read More: Use Code::Blocks with wxWidgets

Anjuta Project Creation

Run Anjuta Create a new project and enter the folder name as project name. ELSE copy your files into the project folder. Verify the path GTK+ C Project Do the Wizard. $ mkdir addbook $ cd addbook $ cp -R /backup/src and /include. At bottom of the screen, you will see Files | Projects | . . . → Read More: Anjuta Project Creation

Projects in Anjuta

Create new Project Copy your src and include files onto it. Then refresh the left panel. Select Project Name Right Click → Properties Compiler Settings Compiler Flags /include/mysql Linker Flags /usr/lib/mysql/ In all programs cinlude mysql as # include Project → Properties → Packages Addressbook, remove libglade. We are not using it.

Remove Gnome from a Glade project

Open *.gladedep or *.glade

Add line to the file



. . . → Read More: Remove Gnome from a Glade project

Install and setup GTK+ and MySQL in Windows

Install Dev C++ (devcpp) Install gtk-dev-2.8.6.DevPak Install mysql.devPak Install mysql gtk_win32_devel_2.8.6_rc3.exe gtk-2.8.6-runtime.exe

In Dev C++, do the following steps:

Add all of Dev_cpp/ lib to Project->ProjectOptions Add libmysql-lib to above also Copy MySQLLib.dll into windows/system32 and this gets rid of the mysql DLL runtime error. Remove files not recognized during build such as ../lib/jpeg-bcc.lib. . . . → Read More: Install and setup GTK+ and MySQL in Windows

Using sscanf for dates in C

Sscanf with following does NOT WORK void change_date_format(char *date_vlaue, char *fmt) { char day[2], month[2], year[4]; sscanf (date_value “%2s/%2s/%4s”, day, month, year); }

Always use the following method: void change_date_format(char *date_value, char *fmt) { int day, month, year; sscanf (date_value, “%2d/%2d/%4d”, day, month, year); sprintf (date_value, “%02d/%02d/%04d”, month, day, year); }

Anjuta Library Addition (for MYSQL)

1.Include Paths = /usr/include/mysql 2.Library Paths = /usr/lib/mysql 3.Libraries = mysqlclient

Error on misbehaving Add button in GTK+

Misbehaving Add button was solved by putting (GtkWidget *) for lookup_widget where they appeared without casting. Widget = lookup_widget(peer_widget, “btnAdd”); This is wrong widget = (GtkWidget *) lookup_widget(peer_widget, “btnAdd”); This is correct.

Segmentation Fault in C Program

Reason for error: – Declared a string sql[200] – Did sprintf(sql, “……”, variables); – String in sql crossed 200 characters. Therefore, program memory space got corrupt leading to above segmentation fault in other variables.

Overcome by debugging – Watch variables for statement where sprintf was there, to see if any memory variable pointers were changed. . . . → Read More: Segmentation Fault in C Program

May 2017
« Mar