Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to port windows dlls to linux Post 302156100 by platso on Monday 7th of January 2008 08:09:17 AM
Old 01-07-2008
How to port windows dlls to linux

Hi all,

I have an application which will run in both windows as well as Linux.
I ported it long back and it is working well.

Now we need to extend the functionality ,so i have written .dll's for
Windows.These dll's have certain dependancies as well.And these are
sucessful in windows.

These dll's were built on Microsoft Visual Studio 2003.

Now I need to port them to Linux Operating System,so that i can extend the
current functionality just like dll's which i made for windows.


->Can any one how to do this porting?

Do i need to write '.so' files in linux from scratch?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Windows dlls to Unix

Hello guys..!!!! We have few windows dlls built using MFC and what would it take to run those on Unix....? What are the other possible approaches to do the same.. Thanks in advance (2 Replies)
Discussion started by: ObjectAnanth
2 Replies

2. UNIX for Dummies Questions & Answers

Windows to Unix via Serial Port

I've got a problem that I could really use some help on. What I'm trying to do is connect a Windows laptop to a Unix desktop in order to feed the unix information from a program that runs on the windows machine. I have the windows machine all set up. But I'm not sure what to do with the Unix box.... (2 Replies)
Discussion started by: GlockCW
2 Replies

3. Solaris

Error message printing to Windows on port 515

Hello, We have an application which runs on Windows 2000 that responds to prrint requests by anyone using RFC1179 protocol on port 515. We are getting an error message when submitting print requests from Sun Solaris 9. "Windows 2000 LPD Server Error: Specified printer does not exist"... (0 Replies)
Discussion started by: pauls
0 Replies

4. Linux

What's better for running Windows software in Linux, Wine or Windows VMware?

What are the differences, advantages, and disadvantages? (1 Reply)
Discussion started by: Advice Pro
1 Replies

5. UNIX for Advanced & Expert Users

port forwarding from unix to windows

Hi, can anyone please tell me how can i do port forwarding from unix box to windows box. Which command will be used for this one. thanks in advance. Arpit (1 Reply)
Discussion started by: thearpit
1 Replies

6. Shell Programming and Scripting

Script to port a file from unix and save in windows

hi, when i finish running some scripts in unix...some csv file is getting generated...now im manually taking this csv file from this generated directory and using FTP, i'm importing to windows os and saving in a directory... please give me a script to automate this..so that i can add in my... (1 Reply)
Discussion started by: dll_fpga
1 Replies

7. Windows & DOS: Issues & Discussions

Port forwarding to windows rdp

I need assistance with a port forwarding related problem. ssh root@adress.com -p2222 -L 3389:192.168.0.10:3389 Have to connect to this 192.168.0.10 ip via rdp standard port from my windows machine. I got the linux command which should work but I just don't know how to use it... (1 Reply)
Discussion started by: genius90
1 Replies

8. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies

9. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

10. UNIX for Beginners Questions & Answers

Seen Windows pc, having all the features of Linux, could exe, read and edit save like windows

Hi, totally new to linux base using windows when started learning and using computers. but i remember that one pc was there , look alike windows desktop, but could not do the task as windows just click and open and view edit etc. But, you could do a little differently even saving in and opening... (8 Replies)
Discussion started by: jraju
8 Replies
Wx::Loader(3pm) 					User Contributed Perl Documentation					   Wx::Loader(3pm)

NAME
Wx::Loader - using custom dll loaders with Wx SYNOPSIS
#--------------------------------------- # For Packagers #--------------------------------------- # the order of these use()s is important use MyCustomWxLoader; use Wx; or ..... use threads; use threads::shared; use MyCustomLoader; use Wx; or - Wx::Perl::Splashfast special case use MyCustomWxLoader; use Wx::Perl::SplashFast ("./logo.jpg",5000); use Wx; ............. meanwhile in MyCustomWxLoader.pm package MyCustomWxLoader; require Wx::Mini; our @ISA = qw( Wx::Loader::Standard ); $Wx::wx_binary_loader = __PACKAGE__; ...... or $Wx::wx_binary_loader = __PACKAGE__->new; #----------------------------------------- # For binary distributions #----------------------------------------- # Provide a custom Wx::Loader::Custom # to be loaded by Wx::Mini package Wx::Loader::Custom our @ISA = qw( Wx::Loader::Standard ); # be polite if another loader is already in place $Wx::wx_binary_loader = __PACKAGE__ if !$Wx::wx_binary_loader; ...... or $Wx::wx_binary_loader = __PACKAGE__->new() if !$Wx::wx_binary_loader; DESCRIPTION
If you are providing binary distributions of Wx or packaging Wx applications to run on machines without Perl (PAR, PerlApp),you may need to override dll loading methods. Providing a custom wx_binary_loader package allows you to do this. Binary Distributions A binary distribution my provide alternative sources and loading methods for the wxWidgets dlls. It achieves this by providing a Wx::Loader::Custom module in the distribution package Wx::Loader::Custom our @ISA = qw( Wx::Loader::Standard ); # be polite if another loader is already in place $Wx::wx_binary_loader = __PACKAGE__ if !$Wx::wx_binary_loader; ...... or $Wx::wx_binary_loader = __PACKAGE__->new() if !$Wx::wx_binary_loader; # remember that Wx.pm has not necessarily been loaded so only # Wx::Mini is available Perl Application Packagers Applications that package perl scripts to run on machines without Perl (PAR, PerlApp etc) can override dll loading methods if necessary by loading a custom package before wx package MyCustomWxLoader; require Wx::Mini; our @ISA = qw( Wx::Loader::Standard ); $Wx::wx_binary_loader = __PACKAGE__; ...... or $Wx::wx_binary_loader = __PACKAGE__->new; # remember that Wx.pm has not necessarily been loaded so only # Wx::Mini is available METHODS
The following methods may be provided by custom loaders to override the default behaviour loader_info should return an information string about the loader and MUST be provided. The default loader has sub loader_info { 'Standard Distribution'; } so any custom loader should return something different e.g. sub loader_info { "Mark's Broken Distribution - it's all my fault"; } set_binary_path allows setting a custom path for the wxWidgets libraries. sub set_binary_path { my $class_or_object = shift; ... work out binary path return $newbinarypath; # method MUST return a path } load_dll Is called to load wxWidgets plugin dlls using a key for the $Wx::dlls hash ( see Wx::Mini ) sub load_dll { my ($class_or_object, $dllkey) = @_; ..... load dll - or maybe not } the default loader does nothing - dependencies are loaded automatically and determined by the standard methods of the os: an example of pre loading a known dependency sub load_dll { return if $^O !~ /^(mswin|linux)/i; local $ENV{PATH} = $Wx::wx_path . ';' . $ENV{PATH} if $Wx::wx_path; return unless exists $Wx::dlls->{$_[1]} && $Wx::dlls->{$_[1]}; my $dll = $Wx::dlls->{$_[1]}; $dll = $Wx::wx_path . '/' . $dll if $Wx::wx_path; Wx::_load_plugin( $dll ); } unload_dll Is called ONCE from within an END block A custom loader may choose, for example to unload any dlls it has loaded sub unload_dll { my $class_or_object = shift; ... carry out END actions } The default unload_dll is a noop ( sub unload_dll {} ) external_set_load A deprecated method of replacing the load function for plugins A custom loader may override this to prevent a legacy loader replacing the loading methods. external_set_unload A deprecated method of replacing the unload function for plugins A custom loader may override this to prevent a legacy loader replacing the unloading methods. boot_overload For binary distributions and packaged applications, normal shared library loading semantics may not work. A custom loader may provide this method to use in place of, or to supplement the standard XS load of Wx.dll (Wx.so). The method MUST return true or false, depending on whether it has loaded Wx.dll (Wx.so). For example, to load the core wxWidgets dlls before Wx is loaded sub boot_overload { shift; require DynaLoader; for my $dll ( qw( base core adv ) ) { next unless exists $Wx::dlls->{$dll} && $Wx::dlls->{$dll}; my $file = ( $Wx::wx_path ) ? $Wx::wx_path . '/' . $Wx::dlls->{$dll} : $Wx::dlls->{$dll}; my $libref = DynaLoader::dl_load_file($file, 0); push(@DynaLoader::dl_librefs,$libref) if $libref; # Dynaloader should take care of unloading } #------------ IMPORTANT ---------- return 0; # we have not loaded Wx #--------------------------------- } Some packagers extract dlls at runtime, and then may attempt to remove them at application close. This may fail for Wx. For example, on MSWin the directory cleanup fails whilst on Linux the application will seg-fault on exit. Packagers may avoid this by loading Wx.dll( Wx.so) from a non standard location ( perhaps a separate binary distribution of wx dlls ) that is not removed at application exit. For example sub boot_overload { my $class = shift require DynaLoader; for my $dll ( qw( base core adv ) ) { next unless exists $Wx::dlls->{$dll} && $Wx::dlls->{$dll}; my $file = ( $Wx::wx_path ) ? $Wx::wx_path . '/' . $Wx::dlls->{$dll} : $Wx::dlls->{$dll}; my $libref = DynaLoader::dl_load_file($file, 0); push(@DynaLoader::dl_librefs,$libref) if $libref; # Dynaloader should take care of unloading } package DynaLoader; my $file = $class->get_the_location_to_wx_xs_module; #------------------------------------------ # From XSLoader #------------------------------------------ my $module = 'Wx'; my $boots = "$module::bootstrap"; my $bootname = "boot_$module"; $bootname =~ s/W/_/g; @DynaLoader::dl_require_symbols = ($bootname); my $boot_symbol_ref; my $libref = dl_load_file($file, 0) or do { require Carp; Carp::croak("Can't load '$file' for module $module: " . dl_error()); }; push(@DynaLoader::dl_librefs,$libref); # record loaded object my @unresolved = dl_undef_symbols(); if (@unresolved) { require Carp; Carp::carp("Undefined symbols present after loading $file: @unresolved "); } $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do { require Carp; Carp::croak("Can't find '$bootname' symbol in $file "); }; push(@DynaLoader::dl_modules, $module); # record loaded module my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file); push(@DynaLoader::dl_shared_objects, $file); # record files loaded #------------ IMPORTANT ---------- return 1; # we have loaded Wx #--------------------------------- } Full Custom Loader Example ################################################ # Custom loader for Wx distribution from # http://www.wxperl.co.uk/repository # ################################################ package Wx::Loader::Custom; use strict; use warnings; our @ISA = qw( Wx::Loader::Standard ); $Wx::wx_binary_loader = __PACKAGE__ if !$Wx::wx_binary_loader; sub loader_info { 'Linux PPM Distribution from http://www.wxperl.co.uk/repository'; } sub boot_overload { shift; require DynaLoader; for my $dll ( qw( base core adv ) ) { next unless exists $Wx::dlls->{$dll} && $Wx::dlls->{$dll}; my $file = ( $Wx::wx_path ) ? $Wx::wx_path . '/' . $Wx::dlls->{$dll} : $Wx::dlls->{$dll}; my $libref = DynaLoader::dl_load_file($file, 0); push(@DynaLoader::dl_librefs,$libref) if $libref; # Dynaloader should take care of unloading } return 0; } # Allow legacy packaging call to override our load method my( $load_fun ) = ( &_load_dll ); sub _load_dll { return unless exists $Wx::dlls->{$_[0]} && $Wx::dlls->{$_[0]}; my $dll = $Wx::dlls->{$_[0]}; $dll = $Wx::wx_path . '/' . $dll if $Wx::wx_path; return Wx::_load_plugin( $dll ); } sub external_set_load { $load_fun = $_[1] } sub load_dll { shift; goto &$load_fun; } perl v5.14.2 2010-02-06 Wx::Loader(3pm)
All times are GMT -4. The time now is 05:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy