开发者

is it possible to have a C/C++ GUI application in linux bare-bone server?

I am very disappointed with my school linux server when doing the homework on it. The reason is: my homework requires to make GUI application.

All the tool that I have is: - ssh from my local machine to school machine - gcc/g++ in my school machine

I have been thinking and tried out different solutions for a week. I still can't be able to figure out how to bring GUI to my application.

Here is some solutions I tried开发者_如何学C: - Install some graphical library (sdl,ncurses...) but school computer does not allow to install because i'm not the root user - Try to compile with /X11/ to produce X-GUI application. Then running it throgh ssh (tunneling). This does not work either because school computer does not have headers file located in X11.

So, What CAN I DO? Anybody has suggestion? I will thank you million times if you could help for a solution.

Thanks you much. tsubasa


It should be possible to install most things, like ncurses or even X11, in user space (in your home directory), if you install them from source. With a Gnu package, you just use --prefix= as an argument to configure, like this:

./configure --prefix=/name/of/directory/to/install/into 

I'm not sure about the other packages.


Without a GUI library to link against, you won't be able to develop a C/C++ app on that server. It seems to me that you have a few options:

1) Develop this GUI app someplace else. If it has to be in Linux, and you're a Windows/Mac user, you can install Ubuntu (or some other Linux Distro) on a Virtual Machine and get a full featured environment.

2) Contact the Linux administrator to explain the homework assignment and convince them to install a GUI package for you. (It may help to have your professor also contact the Linux Administrator) (If you don't know who the linux admin is, try emailing root@linuxbox

3) Bend the rules on what a "GUI" environment is. For example, can your C/C++ app output HTML files for a GUI-like experience through a web-browser?

4) Try to install some sort of GUI package inside your account on the server. This will likely fail unless you are very, very good at administering a linux box, and you've hand-built packages before.


Could do it with ncurses


Perhaps you could ditch the school server and use Virtualbox to run a linux VM locally on your machine and develop on that. It's free.


From "INSTALL" file in ncurses source archive:

The package gets installed beneath the --prefix directory as follows:

In $(prefix)/bin:          tic, infocmp, captoinfo, tset,
          reset, clear, tput, toe
In $(prefix)/lib:          libncurses*.* libcurses.a
In $(prefix)/share/terminfo: compiled terminal descriptions
In $(prefix)/include:      C header files
Under $(prefix)/man:       the manual pages

Note that the configure script attempts to locate previous

installation of ncurses, and will set the default prefix according to where it finds the ncurses headers.

Do not use commands such as

  make install prefix=XXX

to change the prefix after configuration, since the prefix value

is used for some absolute pathnames such as TERMINFO. Instead do this

  make install DESTDIR=XXX

So I'd recommend using "make install DESTDIR=XXX" where XXX is the location where you have write persmissions.

HTH

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜