delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/07/13/09:03:55

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,TW_JC,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <50001CA1.8020809@cs.utoronto.ca>
Date: Fri, 13 Jul 2012 09:03:29 -0400
From: Ryan Johnson <ryan DOT johnson AT cs DOT utoronto DOT ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Differences between C++ 'new' operator and 'malloc()' (NOT a C/C++ question)
References: <1342107001 DOT 13284 DOT ezmlm AT cygwin DOT com> <4bfae5cb28706b33d48372d5a1bd80bb DOT squirrel AT zeusw DOT org> <4FFFDB87 DOT 9060304 AT scluk DOT com>
In-Reply-To: <4FFFDB87.9060304@scluk.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 13/07/2012 4:25 AM, Al Slater wrote:
> On 12/07/2012 16:59, Claude SIMON wrote:
>> Ryan Johnson wrote:
>>>
>>> [...]
>>>
>>> Sorry, I should have actually looked at the repo before assuming the
>>> test case was a monstrosity. By way of penance, I've now looked,
>>> downloaded, tweaked, and tested it.
>>>
>>> [...]
>>>
>>
>> Thanks for testing.
>>
>> I removed your test results (and the other stuff) from this message, not
>> because I'm not interested into, but because I have a new problem, which
>> prevents me to investigate further the original problem in the light of
>> your test results.
>>
>> Since my last testings, I updated Cygwin, the JDK and the JRE. So, my
>> current configuration is now :
>>
>> Windows Vista 32 bits SP2
>> Cygwin 1.7.15
>> g++ 4.5.3
>> javac 1.7.0_05
>> javah 1.7.0_05
>> java 1.7.0_05
>>
>> When running the test case, I now have :
>>
>> $ java jcmc
>> Loading library 'jcmc'...Exception in thread "main"
>> java.lang.UnsatisfiedLinkError: H:\cvs\epeios\bugs\jcmc\jcmc.dll: 
>> L'accÞs
>> Ó cet emplacement de la mÚmoire n'est pas valide
>>          at java.lang.ClassLoader$NativeLibrary.load(Native Method)
>>          at java.lang.ClassLoader.loadLibrary1(Unknown Source)
>>          at java.lang.ClassLoader.loadLibrary0(Unknown Source)
>>          at java.lang.ClassLoader.loadLibrary(Unknown Source)
>>          at java.lang.Runtime.loadLibrary0(Unknown Source)
>>          at java.lang.System.loadLibrary(Unknown Source)
>>          at jcmc.main(jcmc.java:9)
>>
>> There is a French message which roughly means "The access to this memory
>> location is not valid"
>>
>> I updated the test case to reflect your changes :
>>     - 'Makefile' now generates the '.h' file,
>>     - 'Makefile' does no more contain the '--stdcall-alias' linker flag,
>>     - the '.cpp' contains now the `extern "C"' directive,
>>     - the '.h' is removed from test case, since it's now generated by 
>> the
>> 'Makefiile'.
>>
>> I have the new error message with this modified test case, but also with
>> the original one. I suspect that the French error message is issued by
>> Cygwin or by one of its sub-component, since the JVM never issued a
>> message which wasn't in English, but Cygwin did.
>>
>> So, I have to postpone the study of the 'malloc()' related bug until I
>> manage to resolve this new issue ; I then come back to your test 
>> results.
>> But, meanwhile, if someone has an idea why I have this new error...
>>
>> Here again the address where the test case can be found :
>>     http://cvs.savannah.gnu.org/viewvc/epeios/bugs/jcmc/?root=epeios
>>
>
> Does 
> http://cygwin.com/faq/faq.programming.html#faq.programming.msvs-mingw 
> provide any help?
>

Or, just use mingw-gcc, like I suggested before:
> x86_64-w64-mingw32-g++ -static-libgcc -static-libstdc++ -c -g 
> -Ijdk/include -Ijdk/include/win32 "-D__int64=long long"  jcmc.cpp
>
> [...snip...]
> Mingw is a windows-targeted cross compiler that runs under cygwin but 
> produces native windows binaries, so it doesn't have any posix 
> functions available; the -static flags tell mingw to make a truly 
> stand-alone executable that has only standard windows runtime 
> dependencies. 

Just use i686-pc-mingw32-g++ if you're 32-bit, the rest stays the same.

Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019