Hello, I’m new here and thank you in advance for your support.
Since some days I’m struggling to compile the Lime Suite. I’m trying to do it on Windows 10 (fully up-to-date). My objective is to use the examples (basicTX, RX, etc.) as a base for further applications developed on C++ and therefore I have to be able to compile it (and not use the Lime Suite GUI for configuring my solution).
I found at least 3 tutorials how to do it and they all look a bit different to me (some different steps, different SW versions, not all say the same components are required, confuse to understand the whole picture). I tried to strictly follow all of them from scratch and no one led me to a successful compilation. I got all sort of warnings and errors, specially linking errors due to missing libraries and not matching syntax.
Is there an up-to-date tutorial that was made and validated from scratch maybe unifying all these other tutorials? I saw some files like the LimeSuite.h was changed not so long ago. Is it possible that there are some compatibility issues when using this new file and trying to compile the Lime Suite using an old recipe?
Thanks again for the support and best regards!
The links you mention give you the information that you need, they are just not quite clear.
If you down load the latest exe from https://downloads.myriadrf.org/builds/PothosSDR/ and run it it loads everything that you need - all the include files, libraries and dlls. If you build a Visual studio project, you need to set the pointers to the locations of what you need.
Include directories -
“C:/Program Files/PothosSDR/include”
Library directories -
“C:/Program Files/PothosSDR/lib”
Dll directories - it should be in your “PATH” environment variable.
“C:/Program Files/PothosSDR/bin”;
The visual studio compiler should build your programs once you have the paths set.
You can download the free version of visual studio to use.
Thank you very much for your answer, @RightHalfPlane! Taking into consideration that I’m not quite there on this environment and that I could not quite understand the tutorials, would you answer me some general questions so that I can see if I got the idea of this proposed examples on how to program the board using for instance c++.
You could maybe answer in a true/false manner (and for false it would be nice if you could tell me where I could not get it):
-
You don’t have to install the Lime Suite from the source in order to get all necessary files for compiling your own code, for instance the proposed exemples basic RX, basic TX, etc.
-
You don’t have to compile Lime Suite in order to compile your own project. It means that you’re anyway compiling something.
2.a. The output of your own project, let’s say the basic RX example, will be an executable which you can use to access the board and program it in an automatic way, or;
2.b. It will be an executable which will use the Lime Suite to access and configure your board, or;
2.c. This outcome will be a kind of configuration file which has to be uploaded to the board via the Lime Suite.
-
Looking at the directory LimeSuite/src/examples/ on GitHub, I see that there is a CMakeLists file where it’s checked whether I choose to compile something along with the examples:
if (NOT ENABLE_EXAMPLES)
return()
endif()
Here is where I assumed I had to compile Lime Suite each time I wanted to build my own project. Is it so? I’m confused because I’m not sure of this process and what I’ll get in the output.
-
So, assuming that I have to build my project (I’ll do it using Visual Studio Community) using the CMake configuration that can be found on the main directory of the Lime Suite GitHub repository, what exactly do I have to configure and compile in other to be able to have the expected output from these proposed examples? Should I not build the Lime Suite GUI? But then what exactly should be selected on CMake in other to have the expected output?
Thank you again for your support.
1). True - do not need to install LimeSuite - it is already in the Posthos Stuff.
2). If you are using a lime device - You can compile and run the RX example. It will run and access the limeSDR. Nothing has to be uploaded to the limeSDR - it all works thru the libraries.
3). You can build things using Visual Studio and cmake but it is kind of complex and not necessary. In the worst case you would need to build Lime Suite once.
4) . No - you do not need to use cmake.
You just start up Visual Studio, create a “Console App”, add BaseTX.cpp (or whatever) as a source file.
Under “Debug/Program Properties”
add “C:/Program Files/PothosSDR/include” to the “Configeration Properties/ C++/General/ Additional Include Directories” list and
add “C:/Program Files/PothosSDR/lib” to “Configeration Properties/ Linker/General/ Link Library Dependencies” and
add libliquid.lib and SoapySDR.lib to “Configeration Properties/ Linker/input/Additonal Dependencies”.
Make sure you add this to the “Release” version not the “Debug” version. The “Debug” version does not work.
If you get it right, you can run the program and use your limeSDR by selecting “Debug/Start Without Debugging”
@RightHalfPlane, thanks for the clarification! Now I fully understand how it works.
However, I did what you said and configured the project to be aware of these dependencies’ paths. There is still something that is not working properly. It compiles greatly but when it tries to link the parts, I get errors “LNK2019: unresolved external symbol” for all the functions used to control the board:
- LMS_StartStream; LMS_EnableChannel; LMS_GetStreamStatus; LMS_SetNormalizedGain; LMS_SetLOFrequency; LMS_Calibrate; LMS_Open; LMS_StopStream; LMS_SetAntenna; LMS_SendStream; LMS_DestroyStream; LMS_Close; LMS_SetSampleRate; LMS_Init; LMS_SetupStream; LMS_GetDeviceList.
I guess it cannot find the implementation of such functions. I tried to find the header files where these functions are defined and include it manually to my code, but it’s turned in a snow ball. The compiler started complaining about all new messing dependencies and it was just not feasible to do it in this way. I also figured out that the relative paths for most includes would not work correctly in my environment and I had to adjust all of them because the compiler could not automatically find them alone using that syntax.
Do you know how can I fix this? Which specific dependency is responsible for providing the implementation of such functions?
By the way, a recurring problem I had concerning the LimeSuite.h include was also a problem of reference path on windows.
Originally:
#include “lime/LimeSuite.h”
Working now:
#include “…\lime\LimeSuite.h”
So anyway it’s not just a matter of checking out the GitHub repository (tried both master and stable), adding the dependencies and compiling. There is some stuff that has to be adjusted as well (I’m not sure if it works directly like it is now on Linux for instance).
If you can give me some insight on the remaining problem, I’ll be really thankful to you!
Bests!
You need to add one addition item -
add LimeSuite.lib to “Configeration Properties/ Linker/input/Additonal Dependencies” with the rest of the libs.
I forgot it, because I just use the SoaySDR routines.
If you have
“C:/Program Files/PothosSDR/include” in the “Configeration Properties/ C++/General/ Additional Include Directories” list the - using
#include <lime/LimeSuite.h>
should work. I am not sure about #include “lime/LimeSuite.h” .
@RightHalfPlane, thanks for all the support. With your help I could get it running. I’ll paste here a short summary for everyone that will eventually get stuck in the same situation I did:
-
You must have all dependencies available on your computer (drivers, libraries). For the libraries, the easiest way is to install PothosSDR on your computer.
-
In your own code, you’ll include LimeSuite.h in order to use the provided API functions.
-
Add the directory „C:/Program Files/PothosSDR/bin“ to your PATH environment variable, if not yet done. It makes possible to execute your program when it’s compiled. Alternatively, you can copy the file LimeSuite.dll to your project folder.
For Visual Studio Users:
- Create a console application which will have your code as source.
- Go to the project properties and change them as follows:
5.1. Choose Release and select the architecture of your target (the computer in which you’re going to run the controlling program).
5.2. Under „Configuration Properties/C++/General/Additional Include Directories“, add „C:/Program Files/PothosSDR/include“.
5.3. Under „Configuration Properties/Linker/General/Additional Library Directories“, add „C:/Program Files/PothosSDR/lib“.
5.4. Under „Configuration Properties/Linker/Input/Additional Dependencies“, add:
5.4.1. „C:/Program Files/PothosSDR/lib/libliquid.lib“
5.4.2. „C:/Program Files/PothosSDR/lib/SoapySDR.lib“
5.4.3. „C:/Program Files/PothosSDR/lib/LimeSuite.lib“
Command prompt solution:
-
Be sure to know if you’re compiling it for the intended target architecture. For instance, Visual Studio provides you with different Native Tools Command Prompts for the different target architectures.
-
Call the compiler and linker by inserting, for example:
cl example.cpp /link /LIBPATH:“C:\Program Files\PothosSDR\lib“ LimeSuite.lib
(Alternatively, you can copy the file LimeSuite.lib to your project folder and adjust the given path.)