public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* "cannot open shared object file: No such file or directory" - maybe linker option can help?
@ 2014-04-14 16:24 Richard
       [not found] ` <4531b79ba10a4a8fb82bf735566791c3@CO1PR02MB237.namprd02.prod.outlook.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Richard @ 2014-04-14 16:24 UTC (permalink / raw)
  To: cygwin


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: "cannot open shared object file: No such file or directory" - maybe linker option can help?
       [not found] ` <4531b79ba10a4a8fb82bf735566791c3@CO1PR02MB237.namprd02.prod.outlook.com>
@ 2014-04-14 16:51   ` Richard
  0 siblings, 0 replies; 2+ messages in thread
From: Richard @ 2014-04-14 16:51 UTC (permalink / raw)
  To: Bill Ross; +Cc: cygwin


On Mon, 14 Apr 2014, Bill Ross wrote:
> 
> One thing to watch out for is reading the error stream coming from the 
> execution of the external program - there may be useful info there. Some 
> people don't bother to read it.
>
> Good luck,
> Bill
>

Thanks, Bill,

I double checked and my new ProcessBuilder code catches both stdout and 
stderr streams, and there's no output whatsoever other than what I cited 
already.  Good thinking to check, though.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-14 16:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 16:24 "cannot open shared object file: No such file or directory" - maybe linker option can help? Richard
     [not found] ` <4531b79ba10a4a8fb82bf735566791c3@CO1PR02MB237.namprd02.prod.outlook.com>
2014-04-14 16:51   ` Richard

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