Pages

Friday, August 9, 2013

Problems compiling C in XCODE using VISA / NI

Hi,

 

I'm developing a program in C to communicate with my Tektronix oscilloscope. I inherited this project from a friend (who is currently incommunicado), so I can't talk to him about it.

 

Basically, my problem is that my program will not build due to a linker problem. I am using functions from the NI-VISA 5.4 package for OS X 10.8. However, the linker cannot seem to find the correct functions for my system:

 

Undefined symbols for architecture x86_64:

  "_viClose", referenced from:

      _setupVI in oscilloscope.o

      _getData in oscilloscope.o

      _closeInstr in oscilloscope.o

  "_viOpen", referenced from:

      _setupVI in oscilloscope.o

  "_viOpenDefaultRM", referenced from:

      _setupVI in oscilloscope.o

  "_viRead", referenced from:

      _setupVI in oscilloscope.o

      _getData in oscilloscope.o

  "_viStatusDesc", referenced from:

      _setupVI in oscilloscope.o

      _getData in oscilloscope.o

  "_viWrite", referenced from:

      _setupVI in oscilloscope.o

      _getData in oscilloscope.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

These are all pretty basic VISA functions. I struggled in just including the correct header file, as

#include

didn't work. When I went to the verbose form, it worked:

#include "/Library/Frameworks/VISA.framework/Versions/A/Headers/visa.h"

 

However, then the problem started happening that I'm having now -- the object linker can't find the code for the VISA functions. I've tried changing build architctures from x86_64 to just x86, without avail. I'm currently building in i386 x86. I've also tried (under Build Phases -> Link Binary with Libraries) to link the VISA.framework to the project, but this simply gives the linker error "cannot find VISA".

 

I feel like I am missing something very obvious. I'm still operating under the notion that either NI-VISA did not install to the correct location, or that my build settings are incorrect.

 

Does anyone have any insight to lend? I've been searching through different forums for help for almost 2 days now, with no avail.




View the original article here

0 comments:

Post a Comment