MinGW - Trouble Compiling Guile


 
Thread Tools Search this Thread
Top Forums Programming MinGW - Trouble Compiling Guile
# 1  
Old 11-07-2012
Question MinGW - Trouble Compiling Guile

This question is not about programming but compiling with GNU GCC/Make. I am not on a UNIX machine but am using the UNIX-like environment MSYS with MinGW for compiling. The problem that I am having is that I cannot get guile to compile. For some reason it cannot find libltdl which is part of libtool. The libltdl header and library files are located in the default include and lib directories. This is the error that stops the configure script:

Code:
...
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for libltdl... no
configure: error: GNU libltdl (Libtool) not found, see README.

I've checked the README file but have found nothing to help solve this problem. I've tried using the "--with-ltdl-prefix" flag, but it does not help.

I'm sorry if this question is not on topic. I thought this would be the best place since it deals with compiling on UNIX environments and I can't find any compiler specific forums.
# 2  
Old 11-12-2012
In addition to using the right directories that the compile can find static libraries in, look at your dynamic linker man page (the subroutine ld() usually man section 2) to see what the local $LD_LIBRARY_PATH variable name is (some UNIX use other names and one I recall just overloaded $PATH with this duty). Make sure any dynamic libraries lib dir paths are in your $LD_LIBRARY_PATH just like command bin dir paths are in $PATH.

Sometime you need a specific minimum version to support a compile. Naturally, the prerequisite installs have to be for the desired target environment: O/S and CPU.
# 3  
Old 11-13-2012
I recompiled libtool/libltdl as a shared library and it fixed the problem. However, I have a new problem during compilation:

Code:
../../libguile/threads.c: In function 'to_timespec':
../../libguile/threads.c:267:15: error: dereferencing pointer to incomplete type
../../libguile/threads.c:268:15: error: dereferencing pointer to incomplete type
../../libguile/threads.c:275:15: error: dereferencing pointer to incomplete type
../../libguile/threads.c:276:15: error: dereferencing pointer to incomplete type
../../libguile/threads.c: In function 'launch_thread':
../../libguile/threads.c:1015:3: warning: implicit declaration of function 'GC_pthread_detach' [-Wimplicit-function-declaration]
../../libguile/threads.c: In function 'scm_call_with_new_thread':
../../libguile/threads.c:1051:3: warning: implicit declaration of function 'GC_pthread_create' [-Wimplicit-function-declaration]
../../libguile/threads.c: In function 'scm_join_thread_timed':
../../libguile/threads.c:1232:18: error: storage size of 'ctimeout' isn't known
../../libguile/threads.c:1232:18: warning: unused variable 'ctimeout' [-Wunused-variable]
../../libguile/threads.c: In function 'fat_mutex_lock':
../../libguile/threads.c:1456:41: error: dereferencing pointer to incomplete type
../../libguile/threads.c:1457:36: error: dereferencing pointer to incomplete type
../../libguile/threads.c:1458:43: error: dereferencing pointer to incomplete type
../../libguile/threads.c: In function 'scm_lock_mutex_timed':
../../libguile/threads.c:1491:18: error: storage size of 'cwaittime' isn't known
../../libguile/threads.c:1491:18: warning: unused variable 'cwaittime' [-Wunused-variable]
../../libguile/threads.c: In function 'scm_try_mutex':
../../libguile/threads.c:1540:18: error: storage size of 'cwaittime' isn't known
../../libguile/threads.c:1540:18: warning: unused variable 'cwaittime' [-Wunused-variable]
../../libguile/threads.c: In function 'scm_unlock_mutex_timed':
../../libguile/threads.c:1683:18: error: storage size of 'cwaittime' isn't known
../../libguile/threads.c:1683:18: warning: unused variable 'cwaittime' [-Wunused-variable]
../../libguile/threads.c: In function 'scm_timed_wait_condition_variable':
../../libguile/threads.c:1787:18: error: storage size of 'waittime' isn't known
../../libguile/threads.c:1787:18: warning: unused variable 'waittime' [-Wunused-variable]
../../libguile/threads.c: In function 'scm_pthread_cond_timedwait':
../../libguile/threads.c:1988:3: warning: passing argument 3 of 'pthread_cond_timedwait' from incompatible pointer type [enabled by default]
In file included from ../lib/time.h:369:0,
                 from c:\development\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/sys/time.h:3,
                 from ../lib/sys/time.h:38,
                 from ../libguile/scmconfig.h:26,
                 from ../../libguile/bdw-gc.h:24,
                 from ../../libguile/threads.c:27:
c:\development\mingw32\bin\../lib/gcc/mingw32/4.7.1/../../../../include/pthread.h:1097:31: note: expected 'const struct timespec *' but argument is of type 'const struct scm_t_timespec *'
make[3]: *** [libguile_2.0_la-threads.lo] Error 1
make[3]: Leaving directory `/c/Development/Sources/guile-2.0.6/build-win32/libguile'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/c/Development/Sources/guile-2.0.6/build-win32/libguile'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/Development/Sources/guile-2.0.6/build-win32'
make: *** [all] Error 2

It appears that there might be some incompatibilities between guild and pthreads-w32. I will try compiling without thread support.

----- Edit -----

I uninstalled pthreads-w32 and tried compiling again. Now I am getting the following error:

Code:
....
../../libguile/posix.c: In function 'scm_init_posix':
../../libguile/posix.c:2380:36: error: 'scm_init_popen' undeclared (first use in this function)
../../libguile/posix.c:2380:36: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [posix.lo] Error 1
....

----- Edit -----

I finally gave up on guile-2.0.6 and compiled an older version, 1.8.8. It compiled fine after a couple of little fixes:
1) Had to use the following CFLAGS options to configure command for gcc 4.7:
Code:
-Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter

2) Edited config.h to comment out "HAVE_STRUCT_TIMESPEC" since already defined in pthread.h:
Code:
//#define HAVE_STRUCT_TIMESPEC 1

3) Patched file libguile/guile-snarf-docs.in:
Code:
--- libguile/guile-snarf-docs.in.orig    2011-06-02 11:49:24.423491408 +0300
+++ libguile/guile-snarf-docs.in    2011-06-02 11:49:26.174492567 +0300
@@ -23,4 +23,4 @@ 
 ## Let the user override the preprocessor autoconf found.
 test -n "${CPP+set}" || CPP="@CPP@"

-${CPP} -DSCM_MAGIC_SNARF_DOCS "$@"
+${CPP} -P -DSCM_MAGIC_SNARF_DOCS "$@"

Patch source

My only question is can I set an option from the configure command to undefine HAVE_STRUCT_TIMESPEC so that I don't have to manually edit the config.h file?

Last edited by Deluge; 11-13-2012 at 08:19 PM..
# 4  
Old 11-15-2012
The options available in configure can differ, ./configure --help to see if something which does what you want exists.

It may be a bug in configure; its purpose is to autodetect these things for you and generate the .h file accordingly. But if your paths are odd, it can't autodetect everything.
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Programming

Trouble compiling program using the readline library.

Hi: in the info page for readline library I read -- Function: void rl_variable_dumper (int readable) Print the readline variable names and their current values to `rl_outstream'. If READABLE is non-zero, the list is formatted in such a way that it can be made part of an... (1 Reply)
Discussion started by: stf92
1 Replies

2. Programming

Symbols not found for architecture: trouble compiling with C++

Hello, I am writing a program which relies on some heavy astronomy calculations, so I am using libnova c++ astronomy libraries => libnova: libnova. I started off with a simple program to make sure everything compiled ok (below) //Simple example program to test Libnova C++ class libraries ... (2 Replies)
Discussion started by: Tyler_92
2 Replies

3. Programming

Playing Video with MinGW and SDL

Hi All, I was wondering if someone could clarify the best way to display mpeg video with SDL in MinGW. After scouring the internet it seems there is not a lot of information regarding this subject (or at least not up to date) and libraries that are available for this purpose. Any help/... (1 Reply)
Discussion started by: robfwauk
1 Replies
Login or Register to Ask a Question