build gede

build gede on Ubuntu 16.04 xenial with Qt5.8

Download gede-2.0.3.tar.xz from
tar xf gede-2.0.3.tar.xz
cd ~/oss/gede-2.0.3/src
Info: creating stash file ~/oss/gede-2.0.3/src/.qmake.stash
~/oss/gede-2.0.3/src$ make

Posted in CPP, GUI, QT | Leave a comment

Build tea editor

Build tea on macOS sierra

Install qt5: brew install qt5
download tea source code from
unzip ~/Downloads/
cd tea-qt-master
cp -r bin/ /Applications
add /Applications/ to PATH environment variable in ~/.profile

Build tea on Ubuntu 16.04 xenial

sudo apt-get install mesa-common-dev
sudo apt-get install libglu1-mesa-dev
cd tea-qt-master/
Info: creating stash file ~/oss/tea-qt-master/.qmake.stash
Project MESSAGE:
Project MESSAGE:
Project MESSAGE:

Posted in CPP, macOS, Open Source, QT | Leave a comment

wxBoxSizer Horizontal alignment flags are ignored with wxEXPAND

Newer version of wxWidgets reports error:

 ./src/common/sizer.cpp(2091): assert "!(flags & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL))" failed in DoInsert(): Horizontal alignment flags are ignored with wxEXPAND

[1] wxBoxSizer::DoInsert(unsigned long, wxSizerItem*)
[2] WXMSearchReplaceDialog::WXMSearchReplaceDialog(wxWindow*, int, wxPoint const&, wxSize const&) …

wxBoxSizer* BoxSizer2;
BoxSizer2 = new wxBoxSizer(wxVERTICAL);

The fix is removing both like the following:

BoxSizer2->Add(BoxSizer4, 1, wxALL|wxEXPAND, 0);

Another change:

StaticBoxSizer1 = new wxStaticBoxSizer(wxVERTICAL, Panel3, _(“Text Mode”));
StaticBoxSizer1->Add(WxCheckBoxPrintSyntax, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 1); // remove |wxALIGN_CENTER_VERTICAL

To build wxMEdit-3.1.tar.gz with wxWidgets-3.1.0.tar.bz2:

./configure --with-wx-config=~/oss/wxWidgets-3.1.0/wx-config

There is one place need change:

unsigned long FilePathHash(const wxString& name)
 return wxStringHash::stringHash(FilePathNormalCase(name).wc_str());
Posted in CPP, GUI, Open Source | Leave a comment

Solution to valgrind: failed to start tool memcheck/callgrind

Background: I need to run memcheck/callgrind on a system without privilege to install software, so I build valgrind from source code.

Valgrind-3.12.0.tar.bz2 on Ubuntu 14.04 trusty
tar xf valgrind-3.12.0.tar.bz2
onegazhang@trusty:~/oss/valgrind-3.12.0$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0 coregrind/valgrind
valgrind: failed to start tool ‘memcheck’ for platform ‘amd64-linux’: No such file or directory

The solution is passing VALGRIND_LIB environment variable to valgrind.
onegazhang@trusty:~/oss/valgrind-3.12.0$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0/memcheck coregrind/valgrind
valgrind: no program specified
valgrind: Use –help for more information.

callgrind tool reported another error: ERROR: object ‘/home/onegazhang/oss/valgrind-3.12.0/callgrind/’ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. It is fixed by copying the library to desired location.

onegazhang@trusty:~/oss/valgrind-3.12.0$ cp -p /home/onegazhang/oss/valgrind-3.12.0/coregrind/ /home/onegazhang/oss/valgrind-3.12.0/callgrind

Then callgrind works in the same way as memcheck.

onegazhang@trusty:~/workspace$ VALGRIND_LIB=/home/onegazhang/oss/valgrind-3.12.0/callgrind /home/onegazhang/oss/valgrind-3.12.0/coregrind/valgrind –tool=callgrind ./memleak

Btw, the above procedure also worked on arm platform.

Posted in CPP, debug, Open Source | Leave a comment

Install Eclipse Plugin

I failed to install PyDev5.7 Eclipse plugin on Ubuntu 16.04 guest OS hosted by macOS sierra. Can’t access MarketPlace, can’t install by adding url to update site. fortunately there is 3rd way: unzip to eclipse/dropins folder. Eclipse version is eclipse-cpp-neon-3-linux-gtk-x86_64.

Posted in Eclipse, IDE | Leave a comment

Solution to Java program unable to find valid certification path to requested target

On macOS sierra, some Java program encountered error: PKIX path building failed: unable to find valid certification path to requested target

Popular google answer suggested to use keytool to add certificate to $JAVA_HOME/jre/lib/security/cacerts.This solution probably works on other OS like Ubuntu, but it does not work on macOS sierra. I still got such error after adding certificate to $JAVA_HOME.

The root cause is that the application in trouble does not refer to $JAVA_HOME/jre/lib/security/cacerts, but refer to a file in its own installation path like /Applications/ccollab_client/.install4j/jre.bundle/Contents/Home/jre/lib/security/cacerts. After I added certificate to this place, ccollab software works without problem.

Do a search, we’ll find a few cacerts file outside of $JAVA_HOME.

sudo find / -name cacerts -type f

like /Applications/

Posted in Java, Uncategorized | Tagged | Leave a comment

ORBConcurrency thread-per-connection

create file hello_svc.conf with the following content according to this document:
static Resource_Factory “-ORBResources global -ORBReactorType select_mt”
static Server_Strategy_Factory “-ORBConcurrency thread-per-connection”
start naming server:
tao_cosnaming -ORBListenEndpoints iiop://localhost:9999
start servant:
taohelloserver -ORBInitRef NameService=corbaloc:iiop:localhost:9999/NameService -ORBSvcConf ~/workspace/taohelloserver/hello_svc.conf

The document says that it can also be configured by code instead of file:
TAO::ORB::default_svc_conf_entries //TAO_Internal::
(NULL, NULL, “static Server_Strategy_Factory \”-ORBConcurrency thread-per-connection\””);
but I got link error:
/home/onega/workspace/taohelloserver/Debug/../taohelloserver.cpp:21: undefined reference to `TAO::ORB::default_svc_conf_entries(char const*, char const*, char const*)’
collect2: ld returned 1 exit status

[onega@localhost Debug]$ nm –demangle $ACE_ROOT/lib/ | grep “default_svc_conf_entries”
000efa80 t TAO::ORB::default_svc_conf_entries(char const*, char const*, char const*)

There is a post recommended adding TAO_Export to default_svc_conf_entries() in TAO_Internal.h, but I still got the link error after rebuild TAO.

Posted in ACE, CORBA, CPP | Tagged | Leave a comment