After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 92060 - Compilation on Windows
Compilation on Windows
Status: RESOLVED FIXED
Product: libgda
Classification: Other
Component: general
0.8.x
Other Windows
: Normal normal
: ---
Assigned To: Rodrigo Moya
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2002-08-29 22:31 UTC by Fernando Martins
Modified: 2006-05-08 10:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fernando Martins 2002-08-29 22:31:22 UTC
Summary of problems:

1- The addition of: 

LIBGDA_CFLAGS=$(echo $LIBGDA_FLAGS -I/include/glib-2.0 -I/lib/glib-2.0/include)

to configure should not be necessary if pkg-config works ok, which seems
not to be the case. The problem is the glib's pkg-config file in
$prefix/lib/pkgconfig which contains the bogus line
prefix=/target

2- The pre-compiled libraries for glib stuff in 

http://www.gimp.org/~tml/gimp/win32/downloads.html 

are compiled with the -mno-cygwin -fnative-struct flags and so other code
using them must also be compiled with the same options. This means either:
- forget cygwin and the porting of libgda to Windows is harder
- port glib for cygwin (hard) and the porting of libgda is easier

3- Minor bug in

gda_config_get_provider_list (void)

There is no need to look for libraries with ".so" extension. This would
transparently support ".dll" libraries.

But is g_module_open really able to load a .dll???
Comment 1 Gonzalo Paniagua Javier 2002-09-01 01:32:10 UTC
The answer to 3 is: yes.

#include <glib.h>
#include <gmodule.h>

int
main (int argc, char *argv[])
{
        GModule *mod;

        if (argc == 1)
                return 1;

        g_print ("Trying to load %s %d\n", argv [1],
g_module_supported ());
        mod = g_module_open (argv [1], G_MODULE_BIND_LAZY);
        if (mod == NULL) {
                g_print ("Failed: %s\n", g_module_error ());
                return 1;
        } else {
                g_print ("It works!\n");
                g_module_close (mod);
                return 0;
        }
}

Compile this program and give it something like:
C:/cygwin/bin/cygpcre (loading directly from dlname works)
C:/cygwin/lib/libpcre (fails and there is a .la file with a dlname
field that is equals to "../bin/cygpcre.dll")
Comment 2 Rodrigo Moya 2002-09-01 10:14:18 UTC
Yes, but the problem is that we just have a directory, and we have to
get all providers that are in that directory. For linux/unix, in that
dir there is a .so, a .a and a .la for each provider. So, how can we
read the directory and just open the correct file? I added the check
for .so because it opened correctly both the .a and the .so, so I
loaded twice each provider.

So, how can we discard files? Check for .so and .dll extensions?
Comment 3 Fernando Martins 2002-09-01 13:51:52 UTC
It looks like this should be a constant defined at ./configure time. 
If environment is Linux, use ".so", if Windows, use ".dll", ...
Comment 4 Gonzalo Paniagua Javier 2002-09-01 23:20:20 UTC
G_MODULE_SUFFIX :-)

It's "dll" on windows, "so" on linux, "sl" on HP-UX...
Comment 5 Rodrigo Moya 2002-09-02 09:17:30 UTC
ok, I added the usage of G_MODULE_SUFFIX. It works on linux, so please
test it on windows.
Comment 6 Murray Cumming 2006-05-08 10:31:35 UTC
Let's assume this was fixed. Please reopen if it wasn't.