Thursday, June 27, 2013

Debugging dynamic libraries in NetBeans

When you are trying to debug a dynamic library in C or C++ in Netbeans it is frustrating not to be able to step into the code. Since I continue to forget how to set this up I have made some notes for future reference. Maybe other people will have the same problem.

  1. Build the dynamic library as a project in Netbeans
  2. Add it as a project in the project Properties->Build->Linker->Libraries dialog of the main application
  3. Set the library project to build Debug code
  4. Add the library's source folder in the main application to Project Properties->General->Source folders
  5. Add the library project to Properties->Related Projects of the main application project and check the "build" box. (optional)

Now rebuild the main project or just debug it and you should be able to step in to the library code.

Sunday, June 16, 2013

Installing Mango HMI on CentOS Tomcat6

I had a bit of trouble installing the Mango HMI on my CentOS box, but now I've solved it. It's a simple permissions problem, exacerbated by poor error messages in the catalina.log file on tomcat6. Googling the problem just turned up lots of other frustrated users, so I thought I'd wade in with the solution.

Here's the beef: You look in /usr/share/tomcat6/logs/localhost*.log. In there you'll see that the default Derby database didn't have write permission to /var/lib/tomcat6 and /etc/share/tomcat6/. You can find out who is running tomcat easily:

ps aux | grep tomcat

That tells me that "tomcat" is running tomcat. OK. So change the ownership of the two directories to "tomcat" and now restart tomcat6 and Bob's your uncle.