From: Richard <richard@KarmannGhia.org>
To: cygwin@cygwin.com
Subject: "cannot open shared object file: No such file or directory" - maybe linker option can help?
Date: Mon, 14 Apr 2014 16:24:00 -0000 [thread overview]
Message-ID: <alpine.LFD.2.03.1404140907340.13843@KarmannGhia.org> (raw)
Hi All,
First, thank you for the help about ten days ago; I found there WAS an
undefined 'len' - looks like a line somehow got truncated.
In this case, I'm getting this error ONLY when I run the target program
from Java:
"error while loading shared libraries: ?: cannot open shared object file:
No such file or directory"
So far as I have seen, this one program I have is the ONLY one that is
having trouble being launched from Java. Other Cygwin programs (albeit
ones that came with the Cygwin distribution, like cygpath.exe) work
perfectly when called in identical manner. I researched it (via web
search, archives, etc) and nobody seems to have had quite this particular
problem. I know the program had been called from Java in the past quite
successfully, and I have NO IDEA what changed.
I suspected that MAYBE it was due to the java.policy settings, so I spent
a LOT of time trying everything I could think of - entries like this:
permission java.io.FilePermission "C:/cygwin/-", "read, execute";
None of that seemed to have any effect on this problem, so I looked into
the Java call itself. This code literally started about 17 years ago with
Java 1.0 or 1.1, and the call to launch an external program hadn't been
updated in a while, so even though there were no other problems launching
any program desired, I updated it to use the (relatively young, by
comparison) ProcessBuilder strategy. FYI, Java calls whatever shell the
user has configured, in this case Cygwin's /bin/bash with the -c flag,
which then calls the program of interest - in this case the same binary
that had the missing 'len' definition you folks helped me with last week.
Again, if you run it "by hand" or in a script, from the bash prompt, it
runs perfectly.
So I figured there's something wrong with PATH or LD_LIBRARY_PATH or some
such with the Java environment, but that hasn't been fruitful either.
I then got this idea I can maybe include the shared object file - which I
take to be cygwin1.dll - directly in the process image! So, I've tried
linking it in with a linker command identical to how it is normally built
but with the -l option too, like this:
$ gcc -lcygwin1.dll -o ctj.exe ctj.o hashc.o sha1.o;
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld:
cannot find -lcygwin1.dll
collect2: ld returned 1 exit status
Noting that it says it can't find it either, I think this is curious, and
I've tried every varriation of this I can think of - kindly omitted here
in the interests of space. ...This must either not be possible OR I'm
doign it wrong! (An obvious conclusion!)
-harumph- ...I'm stumped! But Persistent!
I read somewhere that maybe strace can be used to help figure these kinds
of things out, but I'm a novice at it. When I run it by hand I get a LOT
of information, but I don't know what I'm looking for, or what to do with
it when I find it!
Any advice / assistance greatly appreciated!
Regards,
Richard
--
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
next reply other threads:[~2014-04-14 16:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-14 16:24 Richard [this message]
[not found] ` <4531b79ba10a4a8fb82bf735566791c3@CO1PR02MB237.namprd02.prod.outlook.com>
2014-04-14 16:51 ` Richard
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=alpine.LFD.2.03.1404140907340.13843@KarmannGhia.org \
--to=richard@karmannghia.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).