tags:

views:

141

answers:

5

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: - 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

+1  A: 

Could do it with ncurses

EMiller
+4  A: 

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.

Kinopiko
I tried this but there's error:apt-get install ncursesE: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
tsubasa
@tsubasa: you cannot use apt-get since you are not root, you should download source package ie .tar.gz .tar.bz2
RageZ
You will probably need to build ncurses from source to install into your home directory; most package managers require root for access to their metadata stores.
Joe
how can I build ncurses from source like you said? I have tried to use ./configure, it works ok. but when doing the 'make install', problem again with root privileges. So how can I be able to build ncurse from the source? Please help.
tsubasa
@tsubasa -- when you do ./configure, do ./configure --help and you should have the ability to pass in a different install path (that will be used later for 'make install')
Joe
@tsubasa: use --prefix=/name/of/directory/to/install/into
Kinopiko
In particular, `--prefix=$HOME` to install into your home directory.
caf
I would never install into my home directory.
Kinopiko
thank you Joe. I did it, got it installed.
tsubasa
Kinopiko: Then you've never really used a real multiuser system. Typically it's the *only* place you can write to, other than `/tmp` and `/var/tmp`.
caf
+1  A: 

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.

Dan
A: 

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.

MadCoder
Or just... INSTALL Linux! It's free, you know...
LiraNuna
A: 

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