1

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

nidaqmx 9.1.7

mingw 64 bit

Netbeans 7.1.2

I created a def file (from C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib64\msvc\nidaqmx.lib). Although the def file 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[2]: *** [dist/Debug/MinGW-Windows/libHelloWorldC.dll] Error 1
make[1]: *** [.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.

greatwolf
  • 20,287
  • 13
  • 71
  • 105
CPL
  • 161
  • 2
  • 10

1 Answers1

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

That message means you're trying to link a 32-bit library (i386) to a 64-bit executable (x86-64). Since you didn't show what the exact commands were used to generate dyyrh.o and libnidaq.a there's no way to tell what you did wrong.

I would suggest checking the switches and options being passed in when you generated those two files. If you're using windres.exe, for example, make sure -F x86-64 is used. Similar if you're using dlltool.exe, there's a similar switch -m x86-64.

You can use objdump on your generated files to check that its format is correct and consistent with the rest of your project build. eg.

objdump -t dyyrh.o 

and

objdump -t libnidaq.a
greatwolf
  • 20,287
  • 13
  • 71
  • 105