Re: [racket-users] Loading foreign libraries on Windows

2019-02-12 Thread George Neuner



On 2/12/2019 11:44 AM, Jens Axel Søgaard wrote:

FWIW here is the readme describing how to build libraries for Windows:

https://github.com/racket/racket/tree/master/racket/src/native-libs


That is a guide useful in general, but it doesn't answer my question to 
Philip.  Plain C DLLs are (for the most part) build-chain agnostic, but 
non-C DLLs can provide C callable functions, and Visual Studio can 
create some types of non-C DLLs that GCC can't.


20 years hence, Microsoft's C compiler isn't even fully C90 compliant.  
They've stated publicly that full C90 compliance will not be achieved 
and C99 and later won't be addressed except for features specifically 
needed by "major customers".


They seem to care much more about C++ compliance than C.  They are 
(AFAIK) fully compliant with C++03.  They aren't fully compliant with 
C++11 or later, but they are much closer to compliance with the C++ 
standards than they are with C.


George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Loading foreign libraries on Windows

2019-02-12 Thread Jens Axel Søgaard
FWIW here is the readme describing how to build libraries for Windows:

https://github.com/racket/racket/tree/master/racket/src/native-libs

Den tir. 12. feb. 2019 kl. 17.37 skrev George Neuner :

> Hi Philip,
>
> On 2/12/2019 1:18 AM, Philip McGrath wrote:
>
> I'm encountering an issue using `ffi-lib` to load a DLL on Windows. The
> problem appears to be specific to Racket, as I seem to be able to load the
> same DLL from Python.
>
> Specifically, I'm trying to build platform-specific packages for libgit2.
> I can build the library and run its test suite successfully, but when I try
> to load the DLL with `ffi-lib`, using an absolute path to avoid any search
> issues, it fails with the message "%1 is not a valid Win32 application.;
> errid=193". The AppVeyor build log is here
> ,
> and this is the Racket script
> 
> that fails to load the DLL. As I mentioned, I can load the DLL successfully
> with this Python script
> 
> .
>
> I'm not much of a Windows person, and I'm not sure what else to do to
> debug this.
>
>
> If it isn't a simple 32-bit/64-bit mismatch, then it could be a lot of
> things.  :-(
>
> Unlike *nix, Windows supports several different kinds of DLLs.  If the
> wrong setting are used to compile or link, a Windows DLL can behave very
> oddly ... including working in one context (Python), but not in another
> (Racket).
>
> You say you built the library from source?   I briefly looked at the
> source, but I'm not very familiar with cmake, and I don't see where the
> compile and link options are being defined.  Which compiler did you use and
> with what settings?
> [If they are defined in the project somewhere, you can just point me to
> the file(s).]
>
> George
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
-- 
Jens Axel Søgaard

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Loading foreign libraries on Windows

2019-02-12 Thread George Neuner

Hi Philip,

On 2/12/2019 1:18 AM, Philip McGrath wrote:
I'm encountering an issue using `ffi-lib` to load a DLL on Windows. 
The problem appears to be specific to Racket, as I seem to be able to 
load the same DLL from Python.


Specifically, I'm trying to build platform-specific packages for 
libgit2. I can build the library and run its test suite successfully, 
but when I try to load the DLL with `ffi-lib`, using an absolute path 
to avoid any search issues, it fails with the message "%1 is not a 
valid Win32 application.; errid=193". The AppVeyor build log is here 
, 
and this is the Racket script 
 
that fails to load the DLL. As I mentioned, I can load the DLL 
successfully with this Python script 
.


I'm not much of a Windows person, and I'm not sure what else to do to 
debug this.


If it isn't a simple 32-bit/64-bit mismatch, then it could be a lot of 
things. :-(


Unlike *nix, Windows supports several different kinds of DLLs.  If the 
wrong setting are used to compile or link, a Windows DLL can behave very 
oddly ... including working in one context (Python), but not in another 
(Racket).


You say you built the library from source?   I briefly looked at the 
source, but I'm not very familiar with cmake, and I don't see where the 
compile and link options are being defined.  Which compiler did you use 
and with what settings?
[If they are defined in the project somewhere, you can just point me to 
the file(s).]


George

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Loading foreign libraries on Windows

2019-02-11 Thread Philip McGrath
I'm encountering an issue using `ffi-lib` to load a DLL on Windows. The
problem appears to be specific to Racket, as I seem to be able to load the
same DLL from Python.

Specifically, I'm trying to build platform-specific packages for libgit2. I
can build the library and run its test suite successfully, but when I try
to load the DLL with `ffi-lib`, using an absolute path to avoid any search
issues, it fails with the message "%1 is not a valid Win32 application.;
errid=193". The AppVeyor build log is here
,
and this is the Racket script

that fails to load the DLL. As I mentioned, I can load the DLL successfully
with this Python script

.

I'm not much of a Windows person, and I'm not sure what else to do to debug
this.

-Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.