This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FileRunner under cygwin - simple compilation fails.


On Tue, 18 Jan 2005, CV wrote:

> Hello,
> FileRunner is a nifty little file manager that I have been
> using for years under Linux and I would like to have it under
> cygwin as well.
>
> But I am stuck with installation on cygwin because I can't
> get the included, very simple c-program to compile, probably
> due to my own cluelessness about where the various libraries
> live etc. (haven't really compiled anything under cygwin yet)
>
> The c-program basically defines a few entry points into TclTk.
> The rest of FileRunner is written in TclTk.
>
> Below is detailed info, including the very simple makefile,
> what changes I made to it and the output from the compilation
> attempt.
>
> My own ideas about what might be wrong:
> 1. TclTk libraries not found (?)
>    I would have expected to find them at /usr/lib/Tcl8.4 and
>    .../Tk8.4, but only the Tk one is there and it appears to
>    be almost empty. It only has one file: pkgIndex.tcl
>    I tried pointing the makefile at that directory, and also
>    at /usr/lib directly but the results were the same.
>    Couldn't find these libs anywhere else either.

Shouldn't TKINC and TCLINC point to where the *header* files are?  I.e.,
/usr/include?

> 2. I am not sure if it is enough to just change ext.so to
>    ext.dll in the makefile, as I did, or if any other switches
>    or libraries possibly come into play for compiling dll's.

Windows doesn't allow DLLs that have undefined symbols -- all undefined
symbols have to be statically resolved (possibly to other DLLs, though).
Try adding -ltk -ltcl to the DLL link line.

> 3. Possibly TclTk8.4 is too new (?) The current version of
>    FileRunner was designed for 8.0. (?)

That you'll have to find out by yourself.

> I am probably missing something obvious.
> Any pointers would be appreciated.
>
> And also nice to hear if anyone has got FileRunner working
> under cygwin. (I tried googling around for any experiences
> with this but turned up nothing.)
>
> My cygwin installation is up to date (done recently) and
> fairly complete, certainly including everyting to do with
> TclTk and its associated libraries.

See <http://cygwin.com/problems.html> for instructions on how to report
your exact version of Cygwin.

> Here is the detailed info:
> -------------------------------------------------------------------------------
> The makefile, based on the one provided for Linux and modified as follows:
> - Changed the include directories, see below
> - Also tried with plain /usr/lib as inc-directories, with similar results
> - Changed ext.so to ext.dll
> and also symlinked X11 to X11R6 under /usr
> -------------------------------------------------------------------------------
> # Change this if you have this stuff somewhere else.
> # TCLINC = /usr/lib/tcl8.0
> # TKINC  = /usr/lib/tk8.0
> TCLINC = /usr/lib/tk8.4
           ^^^^^^^^^^^^^^
           /usr/include
> TKINC  = /usr/lib/tk8.4
           ^^^^^^^^^^^^^^
           /usr/include
> X11INC = /usr/X11/include
           ^^^^^^^^^^^^^^^^
           /usr/include/X11

> CFLAGS = -Wall -fPIC -O3 -I$(TCLINC) -I$(TKINC) -I$(X11INC)
>
> CC = gcc
>
> all: ext.dll
>
> ext.dll: ext.o
> 	gcc -shared -Wl,-soname,ext.dll -o ext.dll ext.o
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        $(CC) -shared -Wl,-soname,ext.dll -o ext.dll ext.o -ltk -ltcl

> -------------------------------------------------------------------------------
> The output from compilation/linking:
> -------------------------------------------------------------------------------
> gcc -Wall -fPIC -O3 -I/usr/lib/tk8.4 -I/usr/lib/tk8.4 -I/usr/X11/include
>    -c -o ext.o ext.c
> cc1: warning: -fPIC ignored for target (all code is position independent)
> ext.c: In function `Ext_Init':
> ext.c:95: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:96: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:97: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:98: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:99: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:100: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:101: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:102: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:103: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:104: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:105: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:106: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:107: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:108: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type
> ext.c:109: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible
>  pointer type

See if /usr/include/tcl.h gets included (you can compile ext.c with "gcc
-E" to find out).

> ext.c: In function `GetEuid':
> ext.c:567: warning: int format, uid_t arg (arg 3)

FYI, Cygwin's uid_t is an unsigned long (32-bit) int.

> gcc -shared -Wl,-soname,ext.so -o ext.so ext.o
> ext.o(.text+0xcac):ext.c: undefined reference to `_Tcl_CreateCommand'
> ext.o(.text+0xcd2):ext.c: undefined reference to `_Tcl_CreateCommand'
> ext.o(.text+0xcf8):ext.c: undefined reference to `_Tcl_CreateCommand'
> ext.o(.text+0xd1e):ext.c: undefined reference to `_Tcl_CreateCommand'
> ext.o(.text+0xd44):ext.c: undefined reference to `_Tcl_CreateCommand'
> ext.o(.text+0xd6a):ext.c: more undefined references
>  to `_Tcl_CreateCommand' follow
> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libcygwin.a(pseudo-reloc.o)
>  (.text+0x52): undefined reference to `___RUNTIME_PSEUDO_RELOC_LIST_END__'
> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../libcygwin.a(pseudo-reloc.o)
>  (.text+0x59): undefined reference to `___RUNTIME_PSEUDO_RELOC_LIST__'

AFAICT, these should be defined by the linker.  Try passing the
--enable-runtime-pseudo-reloc option to it.

> num_of_bfd=65 num_of_left_bfd=0 whole_size=    2608
>  whole_reduced_size=   11448
> collect2: ld returned 1 exit status
> make: *** [ext.so] Error 1

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]