compiling Motif (Lesstif) program

2003-03-06 Thread Klaus . Moschner
Hi,

I just try learning X and Motif.
I have a very simple program:

---snip---
#include X11/Intrinsic.h
#include Xm/Xm.h
#include Xm/Label.h

main(int argc, char *argv[])
{
  Widget toplevel, msg;
  Arg al[10];
  int ac;

  toplevel=XtInitialize(argv[0],,NULL,0,argc,argv);
  ac=0;
 
XtSetArg(al[ac],XmNlabelString,XmStringCreate(hello,XmSTRING_DEFAULT_CHARSET)); 
  ac++;
  msg=XtCreateManagedWidget(msg,xmLabelWidgetClass,toplevel,al,ac);
  XtRealizeWidget(toplevel);
  XtMainLoop();
}
---snip---
and try to compile it using:
gcc -o simple simple.c -I /usr/X11R6/include/ -L /usr/X11R6/lib/ -lXm -lXt
-lX11

the result is this:
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3536):Shell.c: undefined reference
to `_SmcCloseConnection'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3617):Shell.c: undefined reference
to `_SmcModifyCallbacks'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3626):Shell.c: undefined reference
to `_SmcClientID'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3686):Shell.c: undefined reference
to `_SmcOpenConnection'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x37b6):Shell.c: undefined reference
to `_SmcGetIceConnection'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x37cd):Shell.c: undefined reference
to `_IceConnectionNumber'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3d51):Shell.c: undefined reference
to `_SmcSetProperties'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3de4):Shell.c: undefined reference
to `_SmcSetProperties'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3e4d):Shell.c: undefined reference
to `_SmcDeleteProperties'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3e7c):Shell.c: undefined reference
to `_SmcGetIceConnection'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3e85):Shell.c: undefined reference
to `_IceProcessMessages'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x3f26):Shell.c: undefined reference
to `_SmcSaveYourselfDone'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x408a):Shell.c: undefined reference
to `_SmcInteractDone'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x41ab):Shell.c: undefined reference
to `_SmcSaveYourselfDone'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x43f1):Shell.c: undefined reference
to `_SmcInteractRequest'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x448e):Shell.c: undefined reference
to `_SmcInteractDone'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x44da):Shell.c: undefined reference
to `_SmcRequestSaveYourselfPhase2'
/usr/X11R6/lib//libXt.a(Shell.o)(.text+0x4501):Shell.c: undefined reference
to `_SmcSaveYourselfDone'
collect2: ld returned 1 exit status

I assume I must have forgotten something basic. It would be great, if you
could point me to a good source on the Internet or give me a hint.

When executing cygcheck -l I see that lesstif is installed.
gcc is 3.2-3

Cheers,
Klaus

-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!



Re: Antwort: Re: WMaker crashes when starting with startxwin.bat

2003-02-28 Thread Klaus . Moschner
Hi hjb,

this was the sollution!
Actually I had two problems:
1. When I installed cygwin, it didn't create a 'good' home directory. It
cretared a directory '/usr/bin/%USERPROFILE%' because my Windows Home is on a
different drive than my cygwin installation.
2. The correct path to HOME had to be set.
I've done that and now it works.

Cheers,
Klaus


 Hi Klaus
 
  yes, you're probably right. But now the tricky question:
  How can I change the windows home to point to my $HOME in cygwin to 
 solve
  that problem?
 
 take my startxwin.bat as an example. Cygwin is installed on d:\cygwin. The
 
 only customized lines are SET HOME, SET CYGWIN_ROOT, the rest is 
 standard startxwin.bat with different WM-calls REMmed on and off.
 
 HTH
 hjb
 
 
 @echo off
 D:
 SET DISPLAY=127.0.0.1:0.0
 SET HOME=/CYGDRIVE/D/cygwin/home/DV105
 
 REM 
 REM The path in the CYGWIN_ROOT environment variable assignment assume
 REM that Cygwin is installed in a directory called 'cygwin' in the root
 REM directory of the current drive.  You will only need to modify
 REM CYGWIN_ROOT if you have installed Cygwin in another directory.  For
 REM example, if you installed Cygwin in \foo\bar\baz\cygwin, you will need
 
 
 REM to change \cygwin to \foo\bar\baz\cygwin.
 REM 
 REM This batch file will almost always be run from the same drive (and
 REM directory) as the drive that contains Cygwin/XFree86, therefore you 
 will
 REM not need to add a drive letter to CYGWIN_ROOT.  For example, you do
 REM not need to change \cygwin to c:\cygwin if you are running this
 REM batch file from the C drive.
 REM 
 
 SET CYGWIN_ROOT=D:\cygwin
 
 SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%
 
 
 REM
 REM Cleanup after last run.
 REM
 
 if not exist %CYGWIN_ROOT%\tmp\.X11-unix\X0 goto CLEANUP-FINISH
 attrib -s %CYGWIN_ROOT%\tmp\.X11-unix\X0
 del %CYGWIN_ROOT%\tmp\.X11-unix\X0
 
 :CLEANUP-FINISH
 if exist %CYGWIN_ROOT%\tmp\.X11-unix rmdir %CYGWIN_ROOT%\tmp\.X11-unix
 
 
 REM
 REM Startup the X Server, the twm window manager, and an xterm.
 REM 
 ...
 skipped
 
 
 if %OS% == Windows_NT goto OS_NT
 
 REM Windows 95/98/Me
 echo startxwin.bat - Starting on Windows 95/98/Me
 
 goto STARTUP
 
 :OS_NT
 
 REM Windows NT/2000/XP
 echo startxwin.bat - Starting on Windows NT/2000/XP
 
 :STARTUP
 
 
 REM
 REM Startup the programs
 REM 
 
 REM Startup the X Server.
 
 REM start XWin %1
 REM start XWin -fullscreen
 start XWin  -rootless
 REM start XWin -broadcast
 
 REM Startup an xterm, using bash as the shell.
 REM run xterm -sl 1000 -sb -rightbar -ms red -fg yellow -bg black -e 
 /usr/bin/bash
 
 REM setxkbmap de
 REM Startup the twm window manager.
 
 REM run twm
 REM run fvwm2
 REM run openbox
 run wmaker
 
 xrdb -merge .Xresources
 
 REM Set a background color.
 
 REM run xsetroot -solid aquamarine4
 
 exit
 
 

-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!



WMaker crashes when starting with startxwin.bat

2003-02-27 Thread Klaus . Moschner
Hi all,

I just installed Cygwin using the Internet installation including XFree86
and wmaker.
I can start X without any problem and I can start wmaker from the bash
prompt.

The only problem I have is with startxwin.bat. I changed the window manager
in this file from twm to wmaker, but whenever I try, I get the following
error:
Window Maker received signal 11.
I see that X is up and it even changed the background color according to the
settings in startxwin.bat.

In the archive for this mailing list I found the suggestion to change the
HOME path settings, but either I did something wrong there, or the problem is
something else.

I can start wmaker using startxwin.sh and startx - no problem with this.
Just startxwin.bat is the problem and just with wmaker.

I'm really sorry if this is the wrong mailing list, or this is a real bug I
should have reported somewhere else. I just think this is probably not a bug,
because wmaker is running fine when started from the bash.

Thanks very much for any help.

Cheers,
Klaus

-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!



Re: WMaker crashes when starting with startxwin.bat

2003-02-27 Thread Klaus . Moschner
JS,

yes, you're probably right. But now the tricky question:
How can I change the windows home to point to my $HOME in cygwin to solve
that problem?

Klaus

 Hi Klaus,
 
 This answer probably won't help because I'm probably speaking rubbish, but
 I 
 have got the same problem as you, so I know what you're talking about.
 
 You can start wmaker from the cygwin window, but not from a batch file (or
 
 more specifically a windows command window). I think this probably has 
 something to do with the user $HOME, because in Cygwin it knows your $HOME
 
 is /home/user, and under there you have the GNUstep folder with your 
 WindowMaker settings. However your windows home is probably pointing 
 somewhere else, so WindowMaker can't find the GNUstep folder in your home 
 directory, causing it to crash?
 
 JS.
 
 
 Hi all,
 
 I just installed Cygwin using the Internet installation including XFree86
 and wmaker.
 I can start X without any problem and I can start wmaker from the bash
 prompt.
 
 The only problem I have is with startxwin.bat. I changed the window
 manager
 in this file from twm to wmaker, but whenever I try, I get the following
 error:
 Window Maker received signal 11.
 I see that X is up and it even changed the background color according to 
 the
 settings in startxwin.bat.
 
 In the archive for this mailing list I found the suggestion to change the
 HOME path settings, but either I did something wrong there, or the
 problem 
 is
 something else.
 
 I can start wmaker using startxwin.sh and startx - no problem with this.
 Just startxwin.bat is the problem and just with wmaker.
 
 I'm really sorry if this is the wrong mailing list, or this is a real bug
 I
 should have reported somewhere else. I just think this is probably not a 
 bug,
 because wmaker is running fine when started from the bash.
 
 Thanks very much for any help.
 
 Cheers,
 Klaus
 
 --
 +++ GMX - Mail, Messaging  more  http://www.gmx.net +++
 Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!
 
 
 
 _
 Chat online in real time with MSN Messenger http://messenger.msn.co.uk
 

-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!