Jump to content
  • 0

Question

Posted

Hello.
I am trying to write a mex file in matlab to use a USB-1208FS-Plus under linux. I am stuck on a what probably is a very simple problem. I start the script with #include "uldaq.h". Without providing any path, I receive the error "uldaq.h: No such file or directory.". If I provide the path to uldaq.h in libuldaq-1.2.1/src (in matlab: "mex -I/path_to_uldaq/ my_script.c"), then I still receive the errors "undefined reference to `ulGetDaqDeviceInventory`", "undefined reference to `ulCreateDaqDevice`" etc. for every function of uldaq called within the script.
So my question is what exactly do I need to provide to matlab and/or include in the script for successfully compiling the mex file?
Thanks,
Baptiste

2 answers to this question

Recommended Posts

  • 0
Posted

So, first as I described I want to use the DAQ under linux, with which Matlab's Data Acquisition Toolbox is not compatible. That is why I am trying to write my own mex file. Second, my problem concerns specifically the uldaq library. I have not programmed in C for a very long time so I'm a bit confused about how to use the library. In the scripts provided in uldaq, such as AIn.c, the script starts with #include "uldaq.h" and #include "utility.h", and that is enough for the compiler to find functions such as ulGetDaqDeviceInventory. When I try to compile the same code using gcc in matlab, it tells me that it cannot find these functions. That is what I am asking. What path exactly needs to be provided to gcc in order to be able to compile a script like AIn.c ?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...