For example:
There are three files:
dllfct.h:
#ifdef BUILD_DLL
// the dll exports
#define EXPORT __declspec(dllexport)
#else
// the exe imports
#define EXPORT __declspec(dllimport)
#endif
// function to be imported/exported
EXPORT void tstfunc (void);
dllfct.c:
#include <stdio.h>
#include "dllfct.h"
EXPORT void tstfunc (void)
{
printf ("Hello\n");
}
hello.c:
#include "dllfct.h"
int main ()
{
tstfunc ();
return (0);
}
In order to compile dllfct.c to make a DLL,
and compile hello.c to make a EXE to use the DLL,
how can we do these with Dev C++ without use the
following commands?
Commands:
gcc -c hello.c
gcc -c -DBUILD_DLL dllfct.c
dllwrap --output-lib=libtstdll.a --dllname=tst.dll
--driver-name=gcc dllfct.o
gcc -o hello.exe hello.o -L./ -ltstdll
Thanks.
Weijun
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
|