473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

dllimport in C header file Windows vs. Unix

158 100+
Let me explain my problem, Im currently trying to use a Perl module that was built for a Windows OS that uses a .dll and .lib file. I have obtained the c header files that the modules were built with.

I am trying to use SWIG to write my Perl mod with those files but I getting a bunch of errors with the "extern "C" __declspec(dllimport)" command kinda know that basics of the command, its used to declare vars from a .dll. If im wrong please clarify.

My question is what is the equivilent to using .dlls in a unix system and what could i use to port my code over to Unix OS.

Any information on .dll UNIX and Windows and C header files would greatly be appreciated, I am not that familiar with C but i have other coding experience so i can kinda fallow most of it.

Thanks in advance

A few code snippets of the header files.

Expand|Select|Wrap|Line Numbers
  1. //-----------------------------------------------------------
  2. //
  3. //    The _PacketLog structure is used for diagnostic packet
  4. //      monitoring in DMX-Workshop
  5. //
  6. //-----------------------------------------------------------
  7.  
  8. typedef struct      {
  9.                         unsigned long Count;                    //Count of packets between heartbeaks.
  10.                         unsigned long Frequency;                //Packet frequency for last sample
  11.                         unsigned long TotalCount;               //Totals
  12.             }_LogEntry;
  13.  
  14.  
  15. typedef struct S_PacketLog     {
  16.  
  17.                         _LogEntry LogEntry[PkMax];
  18.  
  19.             }_PacketLog;
  20.  
  21.  
  22.  
  23. extern "C" __declspec(dllimport) PipeEntry    PipeLibrary[MaxPipes];
  24. extern "C" __declspec(dllimport) NodeEntry    NodeLibrary[MaxNodes];
  25. extern "C" __declspec(dllimport) _PacketLog    PacketLog;
  26.  
  27.  
Expand|Select|Wrap|Line Numbers
  1. #ifndef __DongleImport_H
  2. #define __DongleImport_H
  3.  
  4. #include "DongleArtNetMS.h"
  5.  
  6. #include "DongleArtNetGlobal.h"
  7.  
  8. #define DLL_MODE __declspec(dllimport)
  9.  
  10. extern "C" WORD DLL_MODE ArtNetInit(char* NewIp);
  11. extern "C" void DLL_MODE ArtNetEnd(void);
  12. extern "C" bool DLL_MODE ArtNetReadWrite(int Pipe);
  13.  
  14. extern "C" void DLL_MODE ArtNetSendUdp(BYTE* Ptr, WORD Size);                           // broadcast
  15. extern "C" void DLL_MODE ArtNetSendUdpPrivate(int NodeIndex, BYTE* Ptr, WORD Size);     // to node's private address
  16.  
Jul 8 '08 #1
1 4235
TamusJRoyce
110 100+
http://bytes.com/forum/thread486852.html (maybe this will help?)

A .so library is the linux version of a .dll. Maybe try searching for how to use winetools (winehq) for using dll functions within linux. But my bet would be that it can't hook into the linux version of mod_python without running apache & mod_perl within wine (and why run linux then?).

I do know some projects have windows .dll's within them under linux such as gimp and win32codec pack for linux, but as to how they do it, I don't know.

You should also probably search apache's website for how to program in C/C++ for mod_perl, too.
Jul 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: kalio80 | last post by:
Hi everyone I posted an enquiry earlier about using c++ code to convert text files between linux & widows. I ended up with this code: #include <iostream> #include <fstream> using namespace...
5
by: Jim Holder | last post by:
I tried building libpcap and tcpdump from my Red Hat 7 RPMs. The tcpdump make couldn't find ioccom.h and sockio.h. When a header file is missing, how do you find it? Thanks.
15
by: Jim | last post by:
I am extremely frustrated. I am building c# application for a call center and am using a third party API to access some hardware. When develop and test my class using the windows console the...
5
by: Felix I. Wyss | last post by:
Good Afternoon, I recently noticed that some very simple methods of a template declared and used in a DLL library get inlined when used by the DLL itself, but not by other DLLs and EXEs. After...
8
by: ginnisharma1 | last post by:
Hi All, I am very new to C language and I got really big assignment in my work.I am wondering if anyone can help me.........I need to port compiler from unix to windows and compiler is written...
3
by: anand.ba | last post by:
Hi, I need to port some C code from UNIX SGI to Windows (MS VC++ compiler). The following header files arent available in windows: #include <sys/param.h> #include <sys/ioctl.h> #include...
5
by: Frederiek | last post by:
Hi, I'm using MS Visual C++ 2005 (MSVC8.0). I am experiencing some kind of linker dilemma. While building a program I am -in a way- forced to use following construct. // aaa_ssf.h - some...
34
by: Mark Sullivan | last post by:
What is the difference between the extensions *.hxx and just *.h for header files ? Can they co-exist? Mark
9
by: jjones7947 | last post by:
Am doing a JNI wrap on a C++ API, am using VC7 and Eclipse. In preparation, I created a C++ executable which mimicked the flow of the JNI, i.e. a driver file which called methods in file with methods...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.