|
From: Edmund Ng <edm...@sc...> - 2000-11-27 22:16:50
|
Folks,
Just a quick question regarding cross compiling a dll. I was just
wondering if anyone was able to make dll using a cross compiler. I"m
having particular trouble with the dllwrap which seems to enjoy
providing sementation faults for me. I am only trying to compile very
simple code show below:
THE HEADER FILE
#ifndef cdll_h_included
#define cdll_h_included
/*
* When building the DLL code, you should define BUILDING_DLL so that
* the variables/functions are exported correctly. When using the DLL,
* do NOT define BUILDING_DLL, and then the variables/functions will
* be imported correctly.
*
* You need to be using egcs-1.1.1 or newer.
*
* Building the DLL:
* - define BUILDING_DLL, which defines DLLIMPORT
__attribute__((dllexport))
* Building the client code:
* - DO NOT define BUILDING_DLL, which defines DLLIMPORT to be one
* __attribute__((dllimport))
*/
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
DLLIMPORT double dll_double_square (double);
#endif /* cdll_h_included */
THE C FILE
#include "cdll.h"
DLLIMPORT double dll_double_square (double d)
{
return d * d;
}
I'm all out of ideas on how to approach this thing so if anyone has any
ideas, please feel free to send it.
Thanks a lot!
Edmund
|