#2283: WIndows: loading objects that refer to DLL symbols
-------------------------+--------------------------------------------------
Reporter: simonmar | Owner:
Type: bug | Status: new
Priority: normal | Milestone: _|_
Component: GHCi | Version: 6.8.2
Severity: normal | Keywords:
Difficulty: Unknown | Testcase:
Architecture: x86 | Os: Windows
-------------------------+--------------------------------------------------
This is a test case from #1288, distilled into a separate report so I can
close #1288:
`test3b.c`:
{{{
#include <stdio.h>
__declspec(dllexport) void _stdcall test(int arg)
{
printf("The argument passed was %i\n", arg );
}
}}}
`test_proxy_5a.c`:
{{{
__declspec(dllimport) void _stdcall test(int arg);
void test_proxy(int arg)
{
test(arg);
}
}}}
To reproduce:
{{{
gcc -c test3b.c
ar -rv test3b.a test3b.o
c:/mingw/bin/dllwrap --export-all-symbols --output-lib test3b.dll.a -o
test3b.dll test3b.a
gcc -c test_proxy_5a.c
ghci -ltest3b test_proxy_5a.o
}}}
the error message we get:
{{{
GHCi, version 6.9.20080512: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Loading object (static) test_proxy_5a.o ... done
Loading object (dynamic) test3b ... done
ghc.exe:
test_proxy_5a.o: unknown symbol `__imp__test'
final link ... ghc.exe: linking extra libraries/objects failed
}}}
I'm not sure to what extent we need to support this, it's possible to link
to the DLL by omitting the dllimport declaration.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2283>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs