From: =?ISO-8859-1?Q?Fran=E7ois_Rappaz?= Newsgroups: comp.lang.java.programmer Subject: Re: Compiling a dll for 64-bits W7 with cygwin and mingw-w64 Date: Thu, 22 Sep 2011 07:04:14 -0700 (PDT) Organization: http://groups.google.com Lines: 55 Message-ID: References: <62e49dff-c206-4a0a-910a-9bc6c72911b0@w8g2000yqi.googlegroups.com> NNTP-Posting-Host: 134.21.47.136 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1316700338 12020 127.0.0.1 (22 Sep 2011 14:05:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 22 Sep 2011 14:05:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c22g2000yqa.googlegroups.com; posting-host=134.21.47.136; posting-account=wZj_SQkAAABdvlUI7EayiBmvtMSZNpUu User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2,gzip(gfe) Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!feed.ac-versailles.fr!usenet-fr.net!proxad.net!feeder1-2.proxad.net!74.125.46.80.MISMATCH!postnews.google.com!c22g2000yqa.googlegroups.com!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8202 On Sep 17, 1:51=A0am, Roedy Green wrote: > On Fri, 16 Sep 2011 07:32:26 -0700 (PDT), Fran=E7ois Rappaz > wrote, quoted or indirectly quoted someone who > said : > > > =A0{System.loadLibrary("kbhook");} > > paths are delicate things. The tiniest typo breaks them. > > seehttp://mindprod.com/applet/wassup.html > > download and run it to dump your system properties. For Linux you > should see : instead of ; between the elements. > > look particularly at: > > java.library.path =3D > E:\sys;.;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:= \Windows\System32\Wbem;F:\Program > Files (X86)\jet7.2-pro\bin;E:\Program > Files\Java\jdk1.7.0\bin;E:\env;E:\sys;F:\Program > Files\JPSoft\TCMD12x64;F:\Program Files\vslick\win;F:\Program Files > (x86)\apache-ant-1.8.2\bin;F:\Program > Files\PostgreSQL\9.0\bin;E:\com\mindprod\reorg;F:\Program > Files\TortoiseSVN\bin;F:\Program Files (x86)\asm;F:\Program Files > (x86)\Microsoft Visual Studio 10.0\Common7\IDE\;F:\Program Files > (x86)\Microsoft Visual Studio 10.0\VC\BIN;F:\Program Files > (x86)\Microsoft Visual Studio > 10.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Progr= am > Files (x86)\Microsoft SDKs\Windows\v7.0A\bin;c:\Program Files > (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft > SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL > Server\100\DTS\Binn\ > -- > Roedy Green Canadian Mind Productshttp://mindprod.com > Your top priority should be fixing bugs. If you carry on development, > you are just creating more places you will have to search for them. At last, with the help of people on mingw-w64- public@lists.sourceforge.net, here is the magical lines to have a dll working with java 64 bits. Under cygwin jdk=3D'/cygdrive/c/Program Files/Java/Jdk1.7.0' x86_64-w64-mingw32-g++ -w -mno-cygwin -I"$jdk/include" -I"$jdk/ include/win32" -static -shared -o foo.dll foo.cpp I could then stripp the size of the dll with x86_64-w64-mingw32-strip foo.dll which gives a 88 kb file instead of 509 kb. F.