public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Claude SIMON" <simon.claude@zeusw.org>
To: cygwin@cygwin.com
Subject: Re: Differences between C++ 'new' operator and 'malloc()' (NOT a C/C++ question)
Date: Wed, 18 Jul 2012 08:42:00 -0000	[thread overview]
Message-ID: <727538151630afee0f9a37532ef80df1.squirrel@zeusw.org> (raw)
In-Reply-To: <1342195424.30517.ezmlm@cygwin.com>

Ryan Johnson wrote:
> 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.
>

Thanks! This is what I finally, and successfully, did. I updated the test
case accordingly.

However, I would like to use the Cygwin 'default' compiler, because this
one is used more often as the 'MinGW' one and especially because I had to
do some tweaks. I had to install the 'libcgj11' package (not a big deal),
but also :
	- to copy '/usr/i686-pc-mingw32/sys-root/mingw/bin/libgcc_s_dw2-1.dll' in
'/bin'
	- in '/bin', to make a copy of 'cyggcj-11.dll' and name it 'libgcj-11.dll'.

Quite awful, isnt't it ? But without that, I didn't manage to make my
component to be loaded.

--
Claude SIMON
http://zeusw.org/


--
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

  parent reply	other threads:[~2012-07-18  8:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1342195424.30517.ezmlm@cygwin.com>
2012-07-18  8:03 ` Claude SIMON
2012-07-18  8:21 ` Claude SIMON
2012-07-18  8:42 ` Claude SIMON [this message]
2012-07-18  9:27   ` Eliot Moss
2012-07-18 10:23     ` Yaakov (Cygwin/X)
     [not found] <1342107001.13284.ezmlm@cygwin.com>
2012-07-12 16:00 ` Claude SIMON
2012-07-13  8:12   ` Csaba Raduly
2012-07-13  8:26   ` Al Slater
2012-07-13 13:03     ` Ryan Johnson
     [not found] <1342037244.32732.ezmlm@cygwin.com>
2012-07-12 12:12 ` Claude SIMON
2012-07-12 14:17   ` Ryan Johnson
     [not found] <1341614850.23157.ezmlm@cygwin.com>
2012-07-10 16:51 ` Claude SIMON
     [not found] <1341539419.17571.ezmlm@cygwin.com>
2012-07-10 16:46 ` Claude SIMON
2012-07-11 19:47   ` Ryan Johnson
     [not found] <1341437446.12368.ezmlm@cygwin.com>
2012-07-05 13:37 ` Claude SIMON
2012-07-05 20:05   ` Ryan Johnson
2012-07-06 11:48   ` NightStrike
2012-07-04  9:45 Claude SIMON
2012-07-04 13:48 ` Ryan Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=727538151630afee0f9a37532ef80df1.squirrel@zeusw.org \
    --to=simon.claude@zeusw.org \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).