[Haskell-cafe] Re: Re: Cabal, GHC, FFI and Visual Studio on
magnus at therning.org
Mon Feb 4 04:47:38 EST 2008
Aaron Denney wrote:
> On 2008-02-03, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
>> Hello Duncan,
>> Sunday, February 3, 2008, 5:24:22 AM, you wrote:
>>> Ok, so you could create a separate component to produce the .dll / .a
>>> from the C code but you'd prefer the convenience of being able to just:
>>> c-sources: blah.c
>>> and have them included in the project, but built using the MS C
>>> So I think we should file a feature request about building C sources
>>> using gcc/ms-c directly rather than going via ghc as that would give us
>>> the flexibility to use alternative C compilers.
>> sorry, i think it's not whole story. gcc and msvc are probably
>> incompatible in the meaning that you can't link together code
>> produced by two compilers. exactly dll should be generated which allow
>> to avoids this incompatibility
> Well, the whole purpose of the ABI is to allow linking code together
> from different compilers. This doesn't mean there won't be any problems,
> but I'd expect the ones that crop up won't *strictly* be because of
> the compilers being different, but because of the C libraries being
> different. DLL vs object files shouldn't change things all that much.
Well, I can at least report that linking a library (.lib) produced using
cl (via CMake) with object files created by GHC works well. I do get a
Warning: .drectve `/manifestdependency:"type='win32'
/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT"
/DEFAULTLIB:"OLDNAMES" ' unrecognized
But it doesn't seem to have any impact on the resulting executable.
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnus＠therning．org Jabber: magnus．therning＠gmail．com
What if I don't want to obey the laws? Do they throw me in jail with
the other bad monads?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080204/4f36e408/signature.bin
More information about the Haskell-Cafe