I am using ZC702 with FMCOMMS5. I have the ADI Linux running on the platform, and iio-oscilloscope is running fine on the system. I can also connect to it from a remote client (Visual Studio on my Windows machine) to send and receive data to iiod host.
But when I try to build the code having iio functions on the Linux platform itself, I get the "Undefined reference" error (please see the attached screenshot. I also tried it from terminal and got the same error).
I am using the build command: [g++ -Wall -liio -o Aurora Aurora.cpp]. It does not complain about finding the header file nor the iio library, but somehow cannot find the reference to the functions.
I also tried re-installing iio library using the procedures in https://wiki.analog.com/resources/tools-software/linux-software/libiio (I tried two methods: 1- the one in: "Building on the Linux Host Target" section, and 2- procedure in "Rebuild LibIIO" section). Please let me know how I can resolve this issue.
Do you get the same error if you build as follows: g++ -Wall -o Aurora Aurora.cpp -liio
Moving to Query to correct forum : Linux Software Driver forum.
It works with this order. I did not know the ordering matters so much. (I am new with programming in Linux)
Thanks for your prompt reply.