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.


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

  1. Hi. I’m trying to set up a windows build environment based on QT5. At least the command line utilities should build without problems and maybe someday someone could migrate the GUI tools from that proprietary compiler to gcc + qt.

    But for now I have enough problems getting the command line tools to build. I’ve started with rtkrcv, but ran into problems with vt.c. It uses the termios.h header/library (for virtual console input/output) that is only available on POSIX systems like Linux. I’m using a gcc compiler from the MINGW project, which comes with a lot of standard headers/lib from the *nix world but is missing termios.h. It would be available in the CYGWIN project (also based on MINGW) but I’m struggling to include that into my QT environment.

    So my question is: How did you manage to compile rtkrcv and vt.c with a Visual Studio setup, which i suppose has no such thing as POSIX headers/libs? Have you modified the code? Is there an external Windows library that supplies implementations for the termios calls?

    Any help is welcome.


    1. Hii, Can any one guide me how to compile and run rtklib in visual studio? I have tried but showing so many header files are not found as they are Linux header files. so to resolve this issue did anyone modify the code or added related header files in windows. I am trying in this way.So anyone can correct me whether I am going in a right way to build the rtklib in visual studio 2o15- creating a new win32 console application and then adding the rtklib .h and other source files which are available in the src folder and also adding the main file rtkrcv . Then building the project. Due to Linux header file P thread and terminos I think so it showing many errors, So please help me to how to resolve this errors

      Any help is welcome


      1. Hi Chaos99. Which apps are you trying to compile? Only the command line apps intended to be run on Windows (e.g. rnx2rtkp and convbin) can be compiled with Visual Studio. There are VS project files in the rtklib/app/*/msc folders. The 2.4.3 release code project files are for VS2008. I have updated the rnx2rtkp and convbin project files to VS2010 in the demo5 code. The GUI apps require the Embarcadero compiler as described in the RTKLIB manual. There is now a starter edition of that available either for free or for a small cost.


  2. The gui versions can be built with C++Builder 10 Seattle (
    A trial version with 30 days full functionality is available.
    I have successfully built the applications with your changes.

    While building RTKNAVI I had an error with an ambiguous call. I could solve it with a cast to double:
    1220 valid=fabs((double)(timediff(time,seph[i].t0)<=MAXDTOE_SBS))&& seph[i].t0.time&&!seph[i].svh;
    1234 valid=fabs((double)(timediff(time,seph[i].t0)fcorr.t0)fcorr.t0.time&& 0fcorr.udre-1&&satp->fcorr.udre-1<14;


      1. Hi Michael. Demo2 was really meant to be just an experiment, not a functional code. I would be very careful using this version for any real data processing. I have renamed that branch “exp1” to emphasize this and will use “demo2” for my next functional code based on analysis of a second data set.

        If you do want to publish that code, I would suggest forking my repository and then updating the fork.

        On the other hand, if you have executables for the demo1 GUIs, that would be great and I’d be happy to add them to that branch of the repository if you send me a link, or even better, a Github pull request.


  3. Hi, I am very interested in your work. I am currenly playing with RTK solutions using RTKLIB with U-Blox M8N und Tallysman antennas. What would be the best way to test your changes in realtime? As RTKNAVI needs Embarcadero compiler, it would be expensive to compile it on your own. For RTKRCV only gcc is available for building.
    What would be the easiest way to compile RTKRCV under windows? Using gcc/windows or Visual C++? Thanks for all information on your blog.


    1. Hi Michael. Interesting … I hadn’t realized that there are no VC++ project files for RTKRCV. I guess most people move to Linux SBC’s for real-time data and then compile in gcc. There is a note at the top of the rtkrcv.c source file that the current version does not support win32 without the pthread library. It looks like the pthread library is available for windows so maybe it can be done but I don’t know any more than that. I have not tried the gcc/windows option. For my own project, I’m thinking of using the Raspberry Pi and the gcc compiler, but haven’t got that far yet


      1. Hi ,
        I am trying to build the RTKNAVI 2.4.3 with visual studio 2010. But I am not getting the .sln file in the folder app/RTKNAVI which is there in github. Can you please tell how to build it? or where I can get the solution files(.sln)?


          1. Hi,
            Thanks for the immediate response. As you suggested I tried to install the Embarcadero compiler free starter edition. But once I install RAD studio 10.1 berlin, I am getting the following error due to which the c/c++ builder is not installed.

            “Operation error:
            Cannot load data from the server:
            Problem extracting compressed file.
            Downloaded file seems to be corrupted.” If you have any solution to this problem, kindly let me know.


          2. Hi Shobhithabhat. I had no trouble downloading the Embarcadero compiler but that was several months ago. I would let them know if you believe it is a problem with the downloaded file.


  4. Hi,
    I’m trying demo1 right now. I’m using the demo1 on my windows O.S. but I suspect there’s no changes between demo1 and rtklib 2.4.3 b8 from the point of view of the GUI applications. Is it right?
    I’m running demo1 also on my linux machine but I can’t get any improvement using the procedure described at
    Can you help me?

    Last, I can’t get and notify message by email. Probably they are filtered out by our insitute e-mail server. Can you provide me the email address of the “notify email sender”
    Thanks in advance


    1. Hi David. Yes you are correct … I have not modified any of the RTKLIB GUI applications because that requires the Embarcadero C++ compiler which I don’t have … all my changes are to the rnx2rtkp CUI application.

      Sorry I really don’t know anything about how WordPress handles email notifications.

      Regarding no improvement with the code fix, did you make the changes (arlockcnt and arelmask) to the config file as well as update the code? My data set is in the demo1/data folder, you might try running with that data first to make sure you can duplicate my results to verify your local code and config before running with your own data. It’s also quite possible that this change won’t improve your results even if you are doing everything right. It only addresses one particular issue, there are many reasons why RTKLIB may not be getting good results. In particular, if you have many cycle slips in your data this fix probably wont help much.


  5. Hi, I’m working with rtklib and low-cost receivers. Currently I’m dealing with a raspberry plus a NVS GPS receiver. I’d like to use your modified code on my linux O.S. I’ve downloaded the demo1 form github and tried under a Microsoft Windows machine. Later on I’ve tried to compile the source code on my Linux machine (as I did for the orginal RTKLIB 2.4.2 and 2.4.3) but the comand ‘make’ alway yelds error messages on every linux module (rnx2rtkp, rtkrcv and so on). Can you help me? Thanks in advance. David


      1. Thanks for answering me. To be honest I didn’t check the fix you told me. I’ll do that a soon as possible. I’m looking forward to try your changes. Thanks again. David


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s