System=MacOSX 10.4.9
Eclipse SDK Version: 3.2.2
Epic 0.5.3.5
I imported some perl files from my solaris box. This test program works
at the command line on my mac but fails within Eclipse on the mac at the
"Use Sybase::CTlib" command. Why is that?
#!/usr/local/bin/perl -w
#
# @(#)ct_sql.pl 1.2 8/7/95
use Sybase::CTlib;
$d = new Sybase::CTlib dsur, password, sybtest1;
# ct_sql() returns a 'reference' to an array:
$ref = $d->ct_sql("select * from hss..aaa");
foreach $line (@$ref) # 'de-reference' the pointer
{
print "@$line\n";
}
# We can also pass a subroutine as the second argument to ct_sql(), and
# it will be called with each row:
sub print_sql {
print "@_\n";
}
$ref = $d->ct_sql( "select * from master..sysprocesses", \&print_sql );
# This time $ref does not point to the results array, because each row
# has been handled by the "callback" proc &print_sql().
# This same call can also be written using an 'anonymous' sub:
$ref =
$d->ct_sql( "select * from master..sysprocesses", sub { print "@_\n";
} );
ERROR:
Can't load '/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Sybase/CTlib/CTlib.bundle'
for module Sybase::CTlib: dlopen(/Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Sybase/CTlib/CTlib.bundle,
1): Library not loaded: libsybct_r.dylib
Referenced from: /Library/Perl/5.8.6/darwin-thread-multi-2level/auto/Sybase/CTlib/CTlib.bundle
Reason: image not found at /System/Library/Perl/5.8.6/darwin-thread-multi-2level/DynaLoader.pm
line 230.
at /Users/dsur/Documents/workspace/cdr_adt/test2.pl line 6
Compilation failed in require at /Users/dsur/Documents/workspace/cdr_adt/test2.pl
line 6.
at /Users/dsur/Documents/workspace/cdr_adt/test2.pl line 6
main::BEGIN() called at /Library/Perl/5.8.6/darwin-thread-multi-2level/Sybase/CTlib.pm
line 6
eval {...} called at /Library/Perl/5.8.6/darwin-thread-multi-2level/Sybase/CTlib.pm
line 6
BEGIN failed--compilation aborted at /Users/dsur/Documents/workspace/cdr_adt/test2.pl
line 6.
at /Users/dsur/Documents/workspace/cdr_adt/test2.pl line 6

jploski wrote on Tue May 1 21:48:46 MEST 2007:

Enable debugger console in preferences to have the invocation of Perl done
by EPIC logged (in the "Error Log" view and workspace/.metadata/.log). Compare
what is different between command-line execution and Eclipse execution.
Command line, working directory and environment variables might all be relevant.

The idea was for you to first enable the debug console in preferences, then
run the script in debug mode and THEN look into the error log to see how
the Perl script is invoked. This information is missing in the pasted log.

dsur wrote on Wed May 2 02:12:17 MEST 2007:

Ok, I understand Jan. Well the Eclipse environment vars are definitely
a subset of what I have in my command line mode. I launched the Eclipse
app via the Mac file browser by double-clicking on the icon. I guess it
brings up some default shell to run Eclipse. This default shell does not
call my default .cshrc files and thus the environments vars are not set
correctly.
If I open a terminal, where all my proper environment vars are set, and
launch the Eclipse app there via the "open Eclipse.app" command, I notice
all the proper environment vars are set and the program runs correctly.
The question now is what is the best way to fix this?
1) Modify some default environment settings in Eclipse?
2) Modify the default shell
3) Launch Eclipse from a shell (Mac Terminal) where all my environment are
set correctly.
Any suggestions would be appreciated.
-Doug

jploski wrote on Wed May 2 16:37:55 MEST 2007:

No experience with Mac, sorry. I think you should be able to solve it at
the OS level without modifying anything in Eclipse, though.

jgangemi wrote on Thu May 3 14:03:14 MEST 2007:

i have a mac - if you want environment variables to be exposed to applications
that you launch via the gui (as opposed to command line), you need to stick
them in the ~/.MacOSX/environment.plist file.
this link should tell you all you need to know - http://snippets.dzone.com/posts/show/586