<blockquote><hr>stadel wrote:<br>1) Jason's method seems to work fine, but I'm concerned, that this method might mess up the stack. As I understood __cdecl means, that the calling function removes the parameters from the stack after the function returned, while __stdcall means, that the function removes the parameters itself. gcs already pointed out that this calling convention is important.<br><hr></blockquote><br>Yes, this is correct. See, <a href="http://www.programmersheaven.com/2/Calling-conventions#stdcall" target=_blank>this</a> description of stdcall for more information. Also note that, according to this site, there are subtle difference between Visual C++ and gcc's implementation of stdcall. These could lead to problems....<br> <br><blockquote><hr><br>2) gcs' suggestion of using attribute does not work (at least I wasn't able to find a difference, when using __attribute__((stdcall)) instead of __stdcall), but I had no experience with these compiler details so far.<br><hr></blockquote><br>How is it not working? Are you getting compiler errors? Linker errors? I don't have gcc for Windows, so I haven't tried this myself. However, I believe that gcc for Windows does support specifying that a function should be called with the stdcall calling conventions.<br><br><blockquote><hr><br>3) a new approach to the problem: gcs also stated that "the NIDAQmx.lib library does have the symbols that are needed". This is surely true, but there seem to be different naming (or "decoration") conventions, as described at<br><a href="http://www.geocities.com/yongweiwu/stdcall.htm" target=_blank>Stdcall and DLL tools of MSVC and MinGW</a><br>In short: the internal represantations of function names have different "decorations". Especially gcc expects, that "@nn" (where nn is the size of all parameters in bytes) is appended to stdcall function names, while the MSVC dll uses the plain name without the "@nn".<br><br><a href="http://www.emmestech.com/software/cygwin/pexports-0.43/moron1.html" target=_blank>Using Microsoft DLL's when Compiling Cygwin or Mingw</a> describes a workaround. Basically one has to write a .def file and then create a library with the "right" names:<br><hr></blockquote><br>One clarification: As noted on the <a href="http://www.geocities.com/yongweiwu/stdcall.htm" target=_blank>Stdcall and DLL tools of MSVC and MinGW</a> page, the format of the symbol names depends on how the DLL is built (DEF file versus dllexport). The NIDAQmx.lib import library does have the proper name decorations and should be what gcc expects. If you invoke <code>dumpbin /exports nidaqmx.lib</code>, the symbols are prefixed by an underscore and appended with the size of their parameters (e.g., ***@32). In fact, the NIDAQmx.lib is the import library for the nicaiu DLL. So, you shouldn't need to create your libmynicaiu import library. NIDAQmx.lib is just such a library.<br><br><blockquote><hr><br>1) call gcc to find the missing function names:<br>$ gcc Acq-IntClk.c -o Acq-IntClk.exe NIDAQmx.lib<br>gcc complains about undefined references as before.<br><hr></blockquote><br>What is the output from this command? If gcc is interpreting the DAQmx functions as stdcall, I would expect this to work.<br><br>Thanks!<br><br>geoff