Skip to content

Building RTKLIB 2.4.3 code with Visual C++ 2010

One of my goals in this project is to make some changes to the RTKLIB solution algorithms and evaluate them specifically for my set of inputs. RTKLIB is intended to work in many different environments. I would like to customize it to be optimal for calculating differential solutions for two single frequency receivers assuming low velocities and open skies. Some of the changes I would like to make are based on what other people have already tried but for which code is not available. Other changes are based on looking at cases in my data where RTKLIB did not provide a good solution, understanding why, and changing the algorithm appropriately.

To make these changes, I need to be able to modify the RTKLIB code and rebuild it. Since I am doing this initial evaluation work on a Windows PC I will need to build the code in that environment. The GUI versions of the RTKLIB programs require the Embarcadero C++ compiler which I do not have and which is fairly expensive to purchase. The CUI versions can be built with Visual C++, which is available for free, so I have chosen to go that path. As mentioned before, I also find the CUI interface with a matlab wrapper better for tracking configuration information for multiple runs.

The project files for Visual C++ are in the rtklib\app\”app name”\msc folders. They are configured for Visual C++ 2008. Since I already have Visual C++ 2010 loaded on my machine I had to make a few changes to make the project files work. Some of the changes would also be required with VS 2008 since it does not look like the project files have been kept up to date with recent RTKLIB changes.

  1. Convert solution files to VS 2010: Click on msc.sln file in rtklib\app\rnx2rtkp\msc folder. This will bring up the visual studio conversion wizard which will convert the VC 2008 project files to VC 2010.
  2. Add new src files to project: Add tides.c and ppp_corr.c to the list of source files in the “Solution Explorer” window by right-clicking on the source folder and selecting “Add”. This prevents build errors from unfound symbols.
  3. Modify Include Directories: Select “Properties” from “Project” tab. Select “General” under “C/C++” under “Configuration Properties” in the menu on the left hand side. Replace the existing entry with “..\..\..\src” to make it independent of code path. This enables the compiler to find the rtklib.h file.
  4. Modify Target Name: Select “General” under “Configuration Properties” in the the menu on the left hand side and change “Target Name” to “rnx2rtkp” to avoid linking errors.
  5. Add winmm library: Select “Input” under “Linker” under “Configuration Properties” in the menu on the left hand side, and add “winmm.lib” to “Additional Dependencies”. This avoids linker errors for an unresolved TimeGetTime symbol.
  6. Fix LPCWSTR conversion warning: Select “General” under “Configuration Properties” in the the menu on the left hand side and change “Character Set” from “Use Unicode” to “Not Set”

To run these apps from the data folders you will need to add the paths for the executables to your Windows path variable. The executables are in app/”app name”/Release/”app name”.exe or app/”app name”/Debug/”app name”.exe depending on whether you built in Debug or Release mode. I always build in Debug mode and point my path variable to that folder just to make it easier to switch between debugging with VS and running stand-alone, but either will work.

9 thoughts on “Building RTKLIB 2.4.3 code with Visual C++ 2010”

  1. hello sir; please can you tell me if I can use the library of rtklib in my project qt; if yes; how can I integrate the library into my project

  2. hi sir, this first time to use rtklib software. I just want to understand how this program processing rtk precise point positioning by real time products. And which source code files is used if i want to build it in MATLAB form

  3. Hello,thanks for the information, I am completely new to RTKlib. My masters research is about integrating Wifi Rssi values with raw GNSS data. For which I will be using the codes given here. I have tried to compile all the files in the SRC together, but due to my lack of knowledge in this field, I am facing problems, and errors, and I think I am not even using the right files. Can you please tell me:
    1) Which files / codes I will use for the purpose of my research?
    2) Also, when I open a project in Visual studio, it creates my own project file, how will I include your project file in there along with the one that is already created when I open a project?
    I will really appreciate if you can help me with these.

  4. Hello,thanks for sharing information about RTKlib, I am completely new to RTKlib. My masters research is about integrating Wifi Rssi values with raw GNSS data. For which I will be using the codes given here. I have tried to compile all the files in the SRC together, but due to my lack of knowledge in this field, I am facing problems, and errors, and I think I am not even using the right files. Can you please tell me:
    1) Which files / codes I will use for the purpose of my research?
    2) Also, when I open a project in Visual studio, it creates my own project file, how will I include your project file in there along with the one that is already created when I open a project?
    I will really appreciate if you can help me with these.

  5. Hi, thanks for your sharing information about RTKLIB. As a new user of RKTLIB,I learned so much from your sharing information. I tried to control the RTKLIB by CUI not GUI, and I tried to compile the rnx2rtk and source code with vs2015 and then hope to run it in windows. but failed always, so hope get your help:
    ① How to compile it successfully ,and then run RTKPOST in CUI
    ② The source code downloaded from github/rtklib has error ,I think, and I failed to compile successfully. So you email your no-error source code to me if you have?
    ③ My email: yueshan99wang@gmail.com

    1. Hi Yueshan. I don’t believe there is an error in the github code. I would suggest trying to build the previous revision and the RTKLIB 2.4.3 version of RTKPOST. If you see similar errors in all three builds then I suspect you have a problem in your build configuration. I am building with VS2017, but it should be possible to build with VS2015. You may have to go to “msc Properties” window from the “Project” tab and check the “Windows SDK version” (you want the most recent option) and the “Platform ToolSet” option. I sometimes find these two options need to be updated for different build environments on Windows. If you find that the problem is in just the latest demo5 revision, and the other two codes build fine, let me know, and I will take a closer look.

  6. Hi, Thanks for this extremely important information. I tried to build the source code with Visual Studio 2017 and I am stuck with two linker error
    1) error LNK2001: unresolved external symbol _encode_rtcm3
    2) ..\rtklib-master\rtklib-master\app\rnx2rtkp\msc\Release\rnx2rtkp.exe : fatal error LNK1120: 1 unresolved externals

    1. Hi Himanshu. I am not able to duplicate the problem you are seeing. I just downloaded the latest version of source code from the rtklibexplorer repository and built rnx2rtkp with Visual Studio 2017 with no errors.

Leave a Reply

Your email address will not be published. Required fields are marked *