From: Patrick G. <pa...@pa...> - 2009-10-14 19:18:46
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Brecht Sanders wrote: <blockquote cite="mid:4AD...@sa..." type="cite"> <pre wrap="">Patrick Galbraith wrote: </pre> <blockquote type="cite"> <pre wrap="">Hi all, I am in the process of trying to get memcached compiled under MinGW which I have been successful with. The problem I'm encountering is running the binary produced, memcached.exe, outside of MinGW, such as using command.com. When I run the program under command.com, I get this error: <a class="moz-txt-link-freetext" href="http://img.skitch.com/20091014-c29tkfk4rihca638p5wsa1ppf1.jpg">http://img.skitch.com/20091014-c29tkfk4rihca638p5wsa1ppf1.jpg</a> </pre> </blockquote> <pre wrap=""><!---->It simply means it didn't find the DLL in your PATH from command.com. If you copy the missing DLL in your PATH or in the same directory as the EXE file it should work. </pre> </blockquote> Brecht,<br> <br> Thank you for the reply. What I meant was that I built memcached.exe against a static pthread library, libpthreadGCE2.a, a static library. If I run memcached.exe (in the same directory it was built in) from MinGW, it runs fine. If I run it in the same directory it was build in from command.com, a dialog window pops up stating it can't find pthreadGCE2.dll, which would happen to be a dynamic library. Also, using 'nm', I can clearly see that the symbols for pthreads is in the memcached.exe binary. So, I'm not quite sure what to do to get this exe file to run and why despite having the symbols it needs, it needs a dynamic library.<br> <br> Again,<br> <br> Thank you!<br> <br> --Patrick<br> <blockquote cite="mid:4AD...@sa..." type="cite"> <blockquote type="cite"> <pre wrap="">Though, if I check the symbols in the executable, you can see it does have the pthread symbols, since I linked against both a static pthread and libevent library: <a class="moz-txt-link-freetext" href="http://img.skitch.com/20091014-cxbqxfh1b3htsprqrfj9w8m741.jpg">http://img.skitch.com/20091014-cxbqxfh1b3htsprqrfj9w8m741.jpg</a> So, the questions I have are: 1. Can you build a program using gcc/MinGW and have it run standalone outside of MinGW - no library dependencies or need to have MinGW installed? </pre> </blockquote> <pre wrap=""><!---->If the EXE is has no dependancies this will work right away. If it depends on DLLs you must make sure they can be loaded when the EXE is run. If you google around you should be able to in which order different locations are searched when a DLL is required. Usually it will be in a folder that is in your PATH environment variable, or in the same directory as the EXE file (I believe the Windows directory and/or the System32 beneath it are also checked). Personally to have something run standalone I just put the DLLs in the same folder as the EXE. To know which DLLs are needed I use depends22_x86 (get it from <a class="moz-txt-link-freetext" href="http://www.dependencywalker.com/depends22_x86.zip">http://www.dependencywalker.com/depends22_x86.zip</a>). To actually copy the DLLs there I go the the folder containing the EXE in an MSYS shell and run the following 4 commands: 'C:\Program Files\Tools\depends22_x86'/depends -c -oc:dll_dependancies.out -f:1 NAME_OF_EXE_OR_DLL_FILE awk -F, '{ print $2 }' dll_dependancies.out | grep -vi `echo $WINDIR\\\|sed 's?\\\?&&?g'` awk -F, '{ print "cp " $2 " ." }' dll_dependancies.out | grep -vi `echo $WINDIR\\\|sed 's?\\\?&&?g'` | grep -v '^cp Module ' | sed -e "s?\"?'?g; s?\\\\?/?g" | sh rm dll_dependancies.out </pre> <blockquote type="cite"> <pre wrap="">2. Can you build dll's from MinGW? </pre> </blockquote> <pre wrap=""><!---->Yes you can. In fact many cross platform libraries can be built with MinGW/MSYS using ./configure && make just like on *nix like platforms. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/devconference">http://p.sf.net/sfu/devconference</a> _______________________________________________ MinGW-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Min...@li...">Min...@li...</a> This list observes the Etiquette found at <a class="moz-txt-link-freetext" href="http://www.mingw.org/Mailing_Lists">http://www.mingw.org/Mailing_Lists</a>. We ask that you be polite and do the same. Most annoying abuses are: 1) Top posting 2) Thread hijacking 3) HTML/MIME encoded mail 4) Improper quoting 5) Improper trimming _______________________________________________ You may change your MinGW Account Options or unsubscribe at: <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/mingw-users">https://lists.sourceforge.net/lists/listinfo/mingw-users</a> </pre> </blockquote> <br> </body> </html> |