|
From: Earnie B. <ea...@us...> - 2012-04-19 12:27:17
|
On Wed, Apr 18, 2012 at 8:56 PM, Srinivas Cherukumilli <va...@ya...> wrote: > Hi, > > We are running into issues trying to load dll's into a program that has been compiled with Visual Studio. We invariably get the "Invalid access to memory location" error while trying to load the dll. It appears that the dll created using mingw gcc-4.2.1 is not relocatable. btw, we are using MSVCR90 and not MSVCRT and this shows up on Windows XP but not Windows 7. > > Followed the instructions mentioned from this article: > http://mirrors.zoreil.com/webclub.kcom.ne.jp/ma/colinp/win32/dll/make.html > Based on colinp in the URL I'm guessing this is old stuff. > gcc -mdll -o junk.tmp -Wl,--base-file,base.tmp bar.o > del junk.tmp > dlltool --dllname bar.dll --base-file base.tmp --output-exp temp.exp --def > bar.def > del base.tmp > gcc -mdll -o bar.dll bar.o -Wl,temp.exp > del temp.exp > You can simply use gcc -shared -o bar.dll bar.o --out-implib libbar.dll.a gcc -Wl,--relocatable -shared -o bar.dll bar.o --out-implib libbar.dll.a > This did not help us either. > Hopefully the above should. > Would appreciate any suggestions that helps resolve this issue. > Let us know if we helped. -- Earnie -- https://sites.google.com/site/earnieboyd |