Frequently Asked Questions (FAQ)
The on-line help within Code Crusader will answer most of your questions. (If you find an omission, please report it.)
There is a separate web site explaining how to use UNIX make.
Table of Contents
- General installation
- General configuration
- Code Crusader configuration
- Editor
- Project
- C++ class tree
- Java class tree
- Mouse and key bindings
- Window manager issues
- Miscellaneous
If you have a question that isn't answered here, please ask us.
If you downloaded the .rpm version, unpack it on the command line with "tar -xzf file_name.tgz", switch to root (easiest via
If you downloaded the .deb version, switch to root (easiest via
If you have a 64 bit computer, then you will need to install support for 32 bit applications. On Ubuntu, install
If you are missing a system library (e.g. libucb.so on Solaris), then search for it on your system and add its directory to your LD_LIBRARY_PATH environment variable.
Otherwise, the answer is yes. Please contact us.
You also have to switch to root before you can install any RPM packages. (If you are running your web browser as root, you are really asking for trouble. For security reasons, you should never do anything as root unless you absolutely must.)
In addition, browsers on Windows think that .rpm files are Real Player files, so we have to use the .tgz suffix to allow people to download our software to a Windows computer (from which they then transfer the file to their UNIX computer).
That said, we are always open to suggestions for improving and simplifying the installation process!
If you are using TightVNC, run vncserver with the -compatiblekbd option.
If you are using Enlightenment, holding down both Meta and Control will get around this problem.
With KDE, go to their control panel LookNFeel/Window Behavior/Actions and set "Modifier Key + Left button" to "nothing".
Note: Unfortunately, Ubuntu 9.10 ignores
Thanks to Ian Wakeling for figuring this out.
If you don't have any project files, then you must have been using it only as an editor. In this case, run it with the command line option --turn-off-external-editor and then change the settings in the Miscellaneous Preferences dialog.
You can use Character Actions (in the Macro Editor dialog) to enforce any indenting style you want.
The Linux utility c2ps can also be used. A script such as:
The directories that you specify in the Search Paths dialog are not passed to the compiler, both because different compilers require different command line options about which Code Crusader cannot know, and because you may want to include files in the C++ class tree that are not directly part of your program or visa versa.
It is also useful to modify the default rule for .y to the following:
If you have one program and several libraries, read the on-line help to see how to link the libraries' project files to the program's project file.
If you have several programs, you could put each in a separate subdirectory and have a top level project that contains the subproject .jcc files and a Makefile that simply builds each subdirectory (makemake + make). This is unfortunately rather ugly, which is why we plan to implement the feature correctly so you can use a single project file.
If you are using Enlightenment, holding down both Meta and Control will get around this problem.
We agree that Code Crusader should allow you to change the bindings. This is on the list of things to do. It is worse when the window manager isn't configurable, however, because then all other programs suffer.
For those of you who don't care about the theory, the on-line help explains all the key shortcuts, including that Meta-left/right-arrow moves the caret to the beginning/end of the line.
The reason that this is this default is simple consistency. Home/End scrolls every other widget that has a scrollbar. The arrow keys are already designated as the keys that move the caret, so modified arrow keys should provide useful shortcuts.
Also, since the Page Up/Down keys affect the scrollbar, the Home/End keys should also affect the scrollbar, since they are grouped together, at least on Macintosh® and PC keyboards.
As usual, the Macintosh® got it right and Windows®/Motif got it wrong.
For those of you who don't care about the theory, the on-line help explains all the key shortcuts, including that Ctrl-up/down-arrow moves the caret to the top/bottom of the visible text.
The reason that this is the default is that it can be very useful to have the caret stay where it is. If you scroll somewhere (e.g. via a scrolltab!) to peek at something, you can get back to where you were by simply pressing any arrow key.
Many people consider fvwm2 to be too raw, however. A good alternative is Openbox, when configured to run gnome-panel at startup. To do this, create
As the error says, the problem is that your window manager is not fully compliant because it doesn't set the WM_STATE property on every window. Our only advice is to notify the developers and then switch to a window manager that works.
On Ubuntu, go to Systems → Preference → Appearance → Visual Effects and then select
If you have trouble with other window managers, please notify us.
General installation
How do I install the package that I downloaded?
If you downloaded the .tgz version, unpack it on the command line with "tar -xzf file_name.tgz", switch to root (easiest via
sudo), and then run the install script included in the package. (The uninstall script will remove the program.)
sudo), and then install the package(s) with "rpm -i --force file_name.rpm". If the installation fails because it cannot find the appropriate version of libstdc++, run "rpm -i --force --nodeps *.rpm".
sudo), and then install the package(s) with "dpkg -i file_name.deb". If the .deb does not work with your version of Debian, use the tar package instead.
I just downloaded and installed the rpm. Where is the binary?
Run "rpm -qlp" on the .rpm file to list the files that it installed.
The binary that I downloaded doesn't work on my system. Does this mean that I have to obtain the source?
If you have Mac OS X, upgrade to the latest version of XQuartz (X11 for Mac).
ia32-libs. Similarly for Debian and RedHat. Other distributions usually provide similar support.
When I start the program, it crashes with the message
The X server does not have any PostScript fonts at all, not even Helvetica
. How do I fix this?
Install the
xorg-x11-fonts-75dpi package.
When I start the program, it crashes before I even get a window. How do I fix this?
Try deleting the file ~/.program_name.pref and the directory ~/.jx/. Also, make sure that you have write permission on your home directory. If this doesn't fix the problem, please contact us.
When I start the program, it complains that the preferences cannot be used. How do I fix this?
This is normally caused by not having write permissions to your home directory or to the
.program_name.pref file inside your home directory.
When I run the program, it is very slow. How do I fix this?
Try hiding the toolbar below the menu in Editor windows. Select
Toolbar buttons...
from the Preference menu and uncheck Show toolbar
. This will produce a dramatic speed increase if you work on an NFS-mounted volume.
When I start the program using MI/X on Windows®, it crashes in JXFontManager.cc. How do I fix this?
Install the fonts Helvetica and Courier. (None of the defaults fonts provided by
MI/X are PostScript fonts.)
Why can't you make the installation process as easy as it is on Mac and Windows?
We would like to, but web browsers on UNIX don't allow you to automatically run a program after you have downloaded it. This is primarily for security reasons. You have to set the executable flag on the program after you have downloaded it.
General configuration
Where is the Meta key?
On Linux-Intel, it is usually labeled Alt. The default on Debian Linux running on a UK keyboard apparently maps Meta to the Windows Logo key. On other UNIX machines, Meta is sometimes labelled with a diamond. If you can't find it by trying the various strangely labelled keys on your keyboard, please ask your system administrator.
Why don't the Meta menu shortcuts work?
Add the following command to your ~/.xinitrc file:
xmodmap -e "keysym Alt_L = Meta_L Alt_L"
Why doesn't Meta-click work?
Your window manager is probably grabbing the mouse click so the program never gets it. Most window managers provide a configuration file that you can change so the mouse click isn't grabbed. If your window manager doesn't allow this, ask the developers to add this feature!
Why does the backspace key delete the character to the right instead of the character to the left?
This is a problem with your X server configuration. Somehow, your backspace key is generating Delete instead of BackSpace. On UNIX, the problem can be solved by adding
xmodmap -e "keycode 22 = BackSpace"
to your ~/.xinitrc file. If you are using an X server for Microsoft Windows®, please consult the appropriate documentation.
Why do I see messages like
sh: warning: setlocale: LC_ALL: cannot change locale (en_US)?
Some distributions, notably Ubuntu, have this problem. Put the following in
~/.xsessionrc:
export LC_ALL=C
~/.xsessionrc. To work around this, add the above line to your ~/.profile (assuming you are using the Bourne shell) and then log out and log back in. If you are using a variant of csh, then put setenv LC_ALL C in ~/.login.
When I use XVision, the Meta key doesn't work. How do I fix this?
Make a copy of the appropriate XVision key mapping file in <XVision installation directory>\System\keymap and then modify it to change the description on the first line (DESC) and to map the desired Windows virtual key code (usually VK_MENU) to the X keycode "0xffe7 (Meta_L)". Save this file and then run <XVision installation directory>\Xkg.exe. From this application's File menu, open the key mapping file you just created. This compiles your .txt file into an .xkg file. Choose "Save" from the File menu and quit the application. Now open the XVision properties dialog and choose the Devices tab. Your new keymap should appear in the Keyboard Map drop down list, based on the change you made to the first line of the .txt file. Select it and then let XVision restart.
On OS X, I don't want to display the location of files using System G. How do I get it to use Finder?
This script will display the file in the Finder. Update the \"Shell cmd to view file in file manager\" command in the Web Browser Preferences dialog to execute the script.
When I type in an input area in a dialog window, buttons and checkboxes get activated. How do I avoid this?
We are not sure what causes this. We think that it may be the result of strange bugs in particular window managers. What is happening is that the program is somehow being told that the Meta key is pressed. Apparently, if you hold down the Meta key, this toggles the setting, i.e., turning the Meta key off, so that you can type normal characters. The best solution is to switch to a different window manager.
Code Crusader configuration
When I start Code Crusader, I get a Save dialog asking to save a project. How do I avoid this?
See the answer to the next question.
I set the preferences to use an external editor and now I can't get it to do anything. How do I get out of this?
Run it with a project file as a command line argument and then change the settings in the Miscellaneous Preferences dialog.
Editor
How do I create a file that I can use as a template for creating many files
with a similar structure? (e.g. a skeleton source file for programming)
Create the file and then use the "Save as template..." item on the File menu.
Can I display all the text files in a single window to reduce the clutter on my screen?
Yes. Right-click on the docktab at the left of the menu bar and select "Dock all windows in default configuration."
Why doesn't Code Crusader support emacs' indenting style?
Code Crusader does not aim to enforce any particular coding standard. Its auto-indent feature only remembers the indent from the previous line.
Why isn't context-sensitive highlighting working on my files?
Check that the file suffix that you use is listed in the File Types dialog window and is set to the appropriate type.
Why aren't comments in preprocessor directives styled correctly?
It's too much trouble for too little gain. Currently, they are styled as part of the preprocessor directive, and this is technically correct, because the preprocessor is the one which sees them and removes them.
Why doesn't the Functions menu appear in my source files?
Check that the file suffix that you use is listed in the File Types dialog window and is set to the appropriate type. You also need to use ctags 5.0 or later, and it needs to be first on your execution path. If neither of these is the problem, please contact us.
How do I print a file so the pages come out in reverse order?
When printing plain text, simply turn on the option in the Page Setup dialog. You can also do it from the command line:
To print styled (PostScript) pages in reverse order, use:
a2ps --output=- file_name | psselect -r | lpr
psselect -r file_name | lpr
How do I print a file with the syntax highlighting?
One option is to use the "Print with styles..." item on the File menu.
can be run from the command line with the name of the file to be printed.
#!/bin/sh
c2ps -t 3 -x -b -f 8 -d 0.80 $1 | lpr
It takes a very long time to open large files. Is there any way to make it
go faster?
Turn off word wrap for the file type that you are opening via the File Types dialog from the Preferences menu.
Why isn't my favorite font available in the Editor Preferences dialog?
Since it is primarily designed for editing code, Code Crusader only allows monospace fonts. If you have a monospace font that isn't listed, please let us know.
Can I use Asian (multibyte) languages in Code Crusader?
No. Compilers only accept ASCII source code, and supporting multibyte languages would double the memory requirements. Someday I hope to add support for Unicode to the underlying library (JX), and then I could release a separate, Unicode version of Code Crusader, but it will be a long and tedious job so I don't plan to do it anytime soon. There are too many other, more important features that require my attention.
Project
Why doesn't it save my project file?
Make sure that the .jcc file is writable. Code Crusader does not save the project file if it is write protected because this would annoy users who share the project file over CVS.
When I try to compile, it complains that it can't find makemake. How do I fix this?
makemake is part of the standard distribution. Make sure that it is on your execution path.
When I try to compile, it complains that it can't find make. How do I fix this?
make may be called something else on your machine. Try creating a symbolic link ~/bin/make that points to your version of make, and make sure that ~/bin/ is at the front of your execution path.
When I try to compile, it complains that it can't find my header files. How do I fix this?
You need to add the directories to SEARCHDIRS in Make.header.
When I try to compile my C++ program, I get linker errors. How do I fix this?
You have to edit Make.header. Check the on-line tutorial for more information.
How do I compile code for Qt/KDE?
Create a project that uses qmake.
How do I configure the project to work with GTK+?
Change Make.header to do the following:
CFLAGS := ${shell gtk-config --cflags}
LOADLIBES := ${shell gtk-config --libs}
My program requires bison. How do I tell make to compile the source files that depend on lex.yy.h after running bison?
Create a build target that runs "makecheck my_bison_file.y" before performing the actual build.
%.c : %.y
@if test -e $*.tab.h; then mv $*.tab.h $*.tab.h_old; fi
@if ! ${YACC} ${YFLAGS} $<; then \
if test -e $*.tab.h_old; then mv $*.tab.h_old $*.tab.h; fi; \
false; fi
@if test -e $*.tab.h_old -a -z "`diff $*.tab.h $*.tab.h_old 2> /dev/null`"; \
then mv $*.tab.h_old $*.tab.h; fi
This avoids changing the modification time of the .tab.h file unless its content changes, thereby avoiding unnecessary recompilation of other source files.
How do I put my source files in a directory other than the source directory?
Please refer to this example.
Can I build multiple versions of a program (e.g. debug and release) or library (e.g. static and shared) from a single project?
Yes. Refer to this explanation.
Can I build several different programs or libraries from a single project?
Not yet. We're working on it.
When I run my command line program, the output from my program's print statements does not appear in the Output window. How do I fix this?
You need to flush the program's output buffer. In C, use fflush(stdout). In C++, use cout << flush.
When I try to use CVS or SVN, it hangs because ssh cannot ask for my password. What can I do about this?
First, set the environment variable
SSH_ASKPASS to point to an AskPass program, like /usr/libexec/openssh/x11-ssh-askpass, /usr/libexec/openssh/gnome-ssh-askpass, or nps-ssh-askpass. Then kill the terminal, if any, from which you ran Code Crusader. This will force SSH to run the AskPass program to get your password. nps-ssh-askpass has the advantage that it runs on Linux, Mac OS X, and Cygwin.
C++ class tree
Why don't my C++ classes show up in the class tree?
Check that the header file suffix that you use is listed in the File Types dialog window and is set to the type "C/C++ header". Then check that you have defined all preprocessor symbols used in your class definitions. The preprocessor definitions are accessed from the Tree menu. If neither of these is the problem, please contact us.
Why don't Qt classes show up in the class tree?
Define Q_EXPORT, Q_ENUMS(), and Q_PROPERTY() to be removed (replaced by the empty string).
Why can't Code Crusader find my source files from the class tree?
Check that the source file suffix that you use is listed in the File Types dialog window and is set to the type "C/C++ source". Then check that the directory containing your source files is listed in the Search Paths dialog. If none of these issues is the problem, please contact us.
Java class tree
Why don't my Java classes show up in the class tree?
Check that the header file suffix that you use is listed in the File Types dialog window and is set to the type "Java". Then check that you have defined all preprocessor symbols used in your class definitions. The preprocessor definitions are accessed from the Tree menu. If neither of these is the problem, please contact us.
Why can't Code Crusader find my source files from the class tree?
Check that the source file suffix that you use is listed in the File Types dialog window and is set to the type "Java". Then check that the directory containing your source files is listed in the Search Paths dialog. If none of these issues is the problem, please contact us.
Mouse and key bindings
Why doesn't Meta-click work in the C/C++ Styles and HTML Styles dialogs?
Why doesn't Meta-drag initiate Drag-and-Drop in the Editor windows?
Your window manager is probably grabbing the mouse click so Code Crusader never gets it. Most window managers provide a configuration file that you can change so the mouse click isn't grabbed. If your window manager doesn't allow this, ask the developers to add this feature!
Why don't the Home/End keys move the caret to the beginning/end of the line?
You can change this behavior in the Editor Preferences dialog.
Why doesn't the caret follow when I scroll the text?
You can change this behavior in the Editor Preferences dialog.
Window manager issues
Which window manager do you recommend using?
All programs that are written with the JX Application Framework will work with any window manager, except for the bugs mentioned below. We at New Planet Software prefer fvwm2 because it supports icons for iconfied windows. This allows Drag-and-Drop onto iconfied windows as well as visible ones.
~/.config/openbox/autostart.sh with the following content:
. $GLOBALAUTOSTART
(sleep 2 && gnome-panel) &
Why do my windows keep appearing in random places, even after I use the "Save window size as default" option?
Your window manager is ignoring the program's attempts to place the windows. We know how to fix this for the following window managers:
Why do I get the error:
Error detected in JXWindow::HandleMapNotify():
Your window manager is not setting the WM_STATE property correctly!
Why do the windows move when I use the Windows or Files menu or the tabs in a dock?
Every window manager seems to have a different way of placing windows. The program attempts to deduce the behavior at run time, so you can use it with any window manager.
None
.
Why do my windows migrate across the screen from one session to the next?
This problem has only been reported for fvwm2. The fix is to create the file ~/.jx/wm_offset. This must contain the x and y offset caused by your window manager. For fvwm2, this file should contain "1 1" (without the quotes).
Miscellaneous
Can I change the default font size?
You can change the default menu font size by creating the file ~/.jx/menu_font with the following format:
font_name
font_size
Does the program support themes?
No. We have a design, but there are still unresolved issues, and everybody seems to be satisfied with the current appearance. Please note that implementing Themes is one of the Bazaar projects for JX. If you want to see it happen, please consider volunteering!
Have you considered porting the program to Gnome/GTK+ or KDE/Qt?
No. The program already runs correctly in both environments, and porting it would require a complete rewrite from scratch.
![[logo]](/nps/image/logo_small.gif)