That looks like a linker error. You might want to start a new thread though, now that you're no longer asking about which GUI API to use. You'll likely get more help with a new thread named something like, "X11 linking error, undefined reference".
> I have no idea of how makefiles works...
The LIBS line sets up a variable named LIBS and contains the string "-lXt -lX11 -lXext" (without the quotes, of course). You should add your "-L/usr/X11R6/lib" right before the "-lXt" and then remove the '-L....' from that gcc line.
I think your linker problem stems from trying to compile CDisplay.cpp with the gcc command. You want to use g++ instead for C++ files (while still using gcc for C files).
Though, it may also be that you need to add more libs to your LIBS variable. The headers that you include in your source file determine which libs you need to link in to your app. There are a number of X libs (they're fairly compartmentalized). If you indeed need to add more libs but don't know which ones to add, you could ask here (in a different thread, possibly entitled, "which Xlibs do I need to link in?").
Edit your makefile to look like this:
Code:
# Set up some variables for the rest of the makefile.
LIBS = -L/usr/X11R6/lib -lXt -lX11 -lXext
APP = CXtest
# The CXtest app depends on the CDisplay.o and cxapi.o files (you need
# those to be already built before building CXtest).
# If CXtest is older than either of those object files, rebuild CXtest using
# the command on the next line after the tab.
${APP}: CDisplay.o cxapi.o
g++ -o ${APP} CDisplay.o cxapi.o ${LIBS}
# Rebuild CDisplay.o if CDisplay.cpp is newer that it is. (i.e. If you've
# modified CDisplay.cpp since the last time CDisplay.o was built, rebuild
# CDisplay.o with the g++ command on that line starting with a tab char).
CDisplay.o: CDisplay.cpp
g++ -c CDisplay.cpp
# By now you're getting how this works. :)
cxapi.o: cxapi.c
gcc -c cxapi.c
Note:
1. You'll need to use tabs instead of spaces in front of those gcc and g++ lines. g++ is just a C++ -specific front-end to gcc.
2. You may need to change that last 'gcc' to 'g++' -- dunno. Give it a try. I think it's most common to just use g++ for everything (instead of gcc) if you have any C++ in your program.
---J