Segfault > IT > Notes > Programming-General
  • When compiling programs that use X headers and need X libraries, add to the "linker flags" (LDFLAGS) "-lX11".
  • To avoid "/usr/bin/ld: cannot find -lX11" error write "-L/usr/X11R6/lib" somewhere before "-lX11".
  • Use "bsh.Interpreter" to run "xxx.java" files.
  • If you're a programmer and want to be able to debug your programs, don't use the flags -fomit-frame-pointer and -O3 in the CFLAGS parameter of /etc/make.conf!!!
  • A list of programming GUIs/IDEs
  • Nvu, Amaya and FCKeditor are two free WYSIWYG (What You See Is What You Get) HTML editors.
  • If, after installing Eclipse C++ / Europa...
    • ...you get the error message...
      run-java-tool is not available for sun-jdk-1.5 on i686
      IMPORTANT: some Java tools are not available on some VMs on some architectures
    • ...then edit the file /usr/bin/run-java-tool and after the line 15...
      tool=$(basename $0)
    • ...insert after that the additional line:
      [[ $tool="run-java-tool" ]] && tool="java"
    • Please mind the blanks after and before the double brackets.
  • If, while starting Eclipse C++ / Europa you get the error message that the file cannot be executed, enable in the kernel the 32-bit compatibility (IA32).
  • If you're using a 64-bit system and Eclipse C++ / Europa doesn't want to start (brings back the execution line in a X window), emerge "emul-linux-x86-java" and select the 32-bit JVM with "java-config".
  • If, during a compilation, you get an error message similar to...
    {standard input}: Assembler messages:
    {standard input}:7095: Warning: end of file in string; '"' inserted
    g++: Internal error: Killed (program cc1plus)
    ...then it's probably because memory is missing (swapfile active?) or because the memory is corrupted.
  • If when trying to use sqlite in a C++-project you get errors like undefined reference to `sqlite3_open' or similar stuff, edit you Makefile and add the instruction -lsqlite3 so that the linker knows it has to bind as well the sqlite libs.
  • If when executing a program which makes usage of QThread you get segmentation faults, make sure that in the Makefile you included the instruction"-DQT_THREAD_SUPPORT" and afterwards clean and recompile the whole project. Make as well sure that QT was compiled using the "thread" flags.
  • An example of using "./configure":
    ./configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu CFLAGS="-march=nocona -O2 -pipe" CXXFLAGS="-march=nocona -O2 -pipe" --prefix=/opt/myprogs/graphicsmagick
  • To compile java programs: javac xxxx.java
  • To run compiled java programs: java xxxx (omit the ".class" ending)
  • If you get in Excel the error message winhttp5.dll or higher must be registered to use the ServerXMLHTTP object, run the following in a command shell:
    C:\>regsvr32 /u C:\OS\system32\msxml4.dll
    C:\>regsvr32 /u C:\OS\system32\msxml.dll
    C:\>regsvr32 C:\OS\system32\msxml.dll
    C:\>regsvr32 C:\OS\system32\msxml4.dll
  • When compiling, the linker flags e.g. "-lsqlite" will make the linker search in /usr/lib64 a file called libsqlite.so.
  • Use QtClipse to partially integrate QT into Eclipse. The standard one works only if all the version numbers match.
  • Analyze performance:
    • valgrind --tool=callgrind ./
    • Run kcachegrind and open the file that was created using the above command.
  • To change in Eclipse Juno the font used for the tabs edit the section ".MPartStack {" in the file...
    [eclipse_home]/plugins/org.eclipse.platform_4.2.1.v201209141800/css/e4_default_gtk.css