c - Creating a DLL in GCC or Cygwin? -



c - Creating a DLL in GCC or Cygwin? -

i need help compile script ("iterator.c") dll. can't utilize vs2010 since not back upwards features added c in c99 standard (i'm using "complex.h" vb doesn't back upwards it).

i've been looking substitute i've found gcc don't know how install/use (really, i've spent half hr reading through documentation , don't understand how supposed install it), , cygwin, i've installed don't know how utilize either. also, i've installed mingw think it's same cygwin more or less, , still don't know how create dll.

it's not i've been lazy , haven't tried it, it's these compilers aren't nil i've ever used before (mostly python idle , visual studio, create things pretty easy you). i'm kind of lost.

could give me advice on how utilize tools create dll can access script? important.

thank in advance.

you must place __declspec(dllexport) in front end of method wish export such as, #define max easier

export_dll void hello() { ... }

to compile dll use

gcc -c -mno-cygwin mydll.c gcc -shared -o mydll.dll mydll.o -wl,--out-implib,libmylib.dll.a

then attach

gcc -o myexe.exe test.o mydll.dll

edit: forgot of import piece, need create mydll.h file include method definition compiler knows reserve spot linker fill in later on. it's simple as

#ifndef mydll_h #define mydll_h extern "c" __declspec(dllexport) #define export_dll __declspec(dllexport) export_dll void hello(); #endif

c gcc dll compiler-construction c99

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -