Many thanks to everyone who posted to this thread. I'd never gone through the process of creating an object library before and having followed the instructions in the post by dplamp (message 14) I was suprised how smoothly it went.
One thing I could add is that the bash script he gives doesn't work for me. Bash gave far too vague error messages to allow me to figure it out. I just prepared the def file by hand and it took maybe two minutes. I actually used excel to trim the whitespace and remove the excess underscores (trim,mid and len functions), less time than it takes to download and install the utilities. Thanks for the clear commenting in your script dplamp !
Great to be using a lean, clean, effficient development environment rather than the expensive monstrosity which is Labview.
I have been trying to get this to work for the last 2 days but cannot. Maybe someone can help me. Let me explain my setup first;
windows 7 64bit
mingw 64 bit
I can create the def file (from C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib64\msvc\nidaqmx.lib) wich i have attached. Although it does not have the @ symbols in it. Is it correct?
I then ran dlltool and created the libnidaq.a file which i used in my linker.
Everything works up to there. The problem is when i try to build i get the following error:
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `../../Createdef/libnidaq.a(dyyrh.o)' is incompatible with i386:x86-64 output
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `../../Createdef/libnidaq.a(dyyrt.o)' is incompatible with i386:x86-64 output
collect2.exe: error: ld returned 1 exit status
make: *** [dist/Debug/MinGW-Windows/libHelloWorldC.dll] Error 1
make: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
I am pretty sure everything is 64 bit so i don't know where this error is coming from.
Any help would be greatly appreciated.
Thanks a lot for contributing to this thread. I would like to get NIDAQmx (17.1) work with MinGW gcc on Windows 10. I am following the text file guidelines of dplamp (Message 14). I have two, probably too simple, questions.
(from dplamp's text file)
1) Install Unix Utils
It provides various utilities, among which the bash shell and the ability to write
bash scripts, sed, etc...
It will let you run the sript that I am enclosing.
Q1: I download the unxutils from the given website link. When I open the zip file, I cannot find any installer. Do you install these unix utils using command prompt? If so, what should I write? Unfortunately, I am not an experienced linux/unix user.
2) Install LibDump
If you have MS Visual C++, you can use dumpbin instead.
Q2: The website link still works, however, it doesn't download the LibDump for some reason. Therefore, I downloaded LibDump 2.0 from http://downloads.fyxm.net/LibDump-80619.html . I haven't installed it yet. LibDump is used to display the content of the library files, thus I do not think the version will matter. (This is not really a question.)
Ohh nevermind, I was able to figure that out. I completed the steps 1,2,3 and 4 in the text file of dplamp. As for step 5, it recommends this:
5) Run mkdef.sh bash script :
- copy the script to C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib
- open the script file with a text editor to check the path to sh on your system
- invoke the bash shell :
- run the script :
./mkdef.sh nicaiu.dll.exp NIDAQmx.dump > nidaqmx.def
If you get errors, you may have to make 500-line chunks from the .exp, run the script on
every chunk, and concatenate the .def chunks generated.
To make chunks, check head --help and tail --help. Type grep -c -e "^" to count the lines in the file.
I chunk a 1884 line file with the following commands :
head -500 > chunk1.exp
head -1000 | tail -500 > chunk2.exp
head -1500 | tail -500 > chunk3.exp
head -2000 | tail -384 > chunk4.exp
I concatenate the results like this :
chunk1.def > nidaqmx.def
chunk2.def >> nidaqmx.def
chunk3.def >> nidaqmx.def
chunk4.def >> nidaqmx.def
I personnally have to reboot the PC after such an error occurs. I suspect some memory leak
somewhere in the UnxUtils package.
When I run the script, I get the following error:
C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib>bash ./mkdef.sh
./mkdef.sh: line 2: $'\r': command not found
./mkdef.sh: line 19: $'\r': command not found
./mkdef.sh: line 20: $'\r': command not found
./mkdef.sh: line 21: $'\r': command not found
./mkdef.sh: line 56: syntax error near unexpected token `$'do\r''
'/mkdef.sh: line 56: `do
I would be grateful if someone could suggest me anything.