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.

Advertisements

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

  1. Hi David
    Have you tested version 2.4.3 in PPP mode? I have build rnx2rtkp using VS2017. It works in single point mode but not in PPP. I used the same files and command line with 2.4.2 version. It can work in PPP mode.

    Like

    1. Hi Ramin,

      I have also had more luck with the 2.4.2 version than the 2.4.3 version for PPP solutions. I find the 2.4.3 version (release or demo5) only works intermittently with PPP solutions using downloaded files and not at all when trying to use SBAS corrections.

      Like

      1. Hi
        Thanks for replying,
        The 2.4.3 version is working in PPP mode. But the solution flag Q = 0 all the time. Are you sure you can get valid PPP solution using the 2.4.3 version?

        Like

        1. Hi Ramin. I would enable the debug trace and look at the debug file to see why you have Q=0. It may be a simple issue such as RTKLIB not being able to find one of your files. On the other hand, I have found cases where PPP solutions work with the 2.4.2 version of RTKLIB but not 2.4.3 (release or demo5), particularly with single frequency solutions or when using SBAS corrections.

          Like

  2. Hi Tim — I am trying to follow your process here to build rnx2rtkp in VS 2012. But when I try to open (and convert) the solutions msc.sln file under rtklib_2.4.3/app/rnx2rtkp/msc/ , it fails to open it as it is looking for msc.vcxproj file which is not there. Do you know where I can find the associated .vcxproj file? Thanks

    Like

    1. Hi Kambiz. Interesting … it looks like they tried to update the VS project files to VS 14 in the 2.4.3 release b25 but deleted the old .vcproj file and forgot to check in the new .vcxproj file. You have at least three solutions:

      1) Build the code with the Embarcadero compiler using the .cbproj file in the bcc folder.

      2) Get the old msc.sln and msc.vcproj files from release b24 and upgrade yourself. You may need to change the “Windows SDK Version” in the Project Properties (select the newest in the list) and update the list of source files to include new source files (ppp_corr.c and tides.c).

      3) Download my demo5 code from Github and copy the msc.sln and msc.vcxproj files over to the release code. This works if you are running VS 2017 on your computer but I haven’t tried it with VS 2012.

      Like

  3. Hi rtkeplorer. Wanted to ask whether you still couldn’t compile the GUIs using visual studio? Never tried something like this before so I wanted to give it a try.

    Thanks
    Mike

    Like

  4. Hello! i have rtklib 2.4.2 and VS2017 community. I followed the steps above and after rebuilding solution there are errors: ppp_corr.c(26): error C2143: syntax error: missing ‘)’ before ‘
    1>......\src\ppp_corr.c(26): error C2143: syntax error: missing ‘{‘ before ‘

    1>......\src\ppp_corr.c(26): error C2059: syntax error: ‘type’
    1>......\src\ppp_corr.c(26): error C2059: syntax error: ‘)’
    1>......\src\ppp_corr.c(39): error C2143: syntax error: missing ‘)’ before ‘
    1>......\src\ppp_corr.c(39): error C2143: syntax error: missing ‘{‘ before ‘

    1>......\src\ppp_corr.c(39): error C2371: ‘gtime_t’: redefinition; different basic types
    I have downloaded ppp_corr.c and tides.c in the following site :: http://sid.ethz.ch/debian/rtklib/2/rtklib-2.4.3%2Bdfsg1/src/.
    because there is an absence of those files (ppp_corr.c and tides.c) in rtklib source folder. After downloading them i just copied them in source folder directly and added them in VS to source folder as an existed file (as it’s written in 2 paragrapg above).
    Can anybody telll what’s problem with ppp_corr.c file and what to do ?

    Like

    1. Hi Sagindykova. Is there a reason you are using the 2.4.2 code? It has not been maintained in a long time. I would recommend switching to either the 2.4.3 code or the demo5 code depending on what you are trying to do.

      Like

      1. please is there any easy way or step of downloading RTKLIB 2.4.3. The one i downloaded was zipped then i unzipped it but still i can’t find any thing in its binary (bin).

        Like

  5. 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.

    Like

    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

      Like

      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.

        Like

  6. The gui versions can be built with C++Builder 10 Seattle (https://www.embarcadero.com/de/products/cbuilder).
    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:
    mondlg.cpp
    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;

    Like

      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.

        Like

  7. 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.

    Like

    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

      Like

      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)?

        Like

          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.

            Like

          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.

            Like

  8. 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 https://rtklibexplorer.wordpress.com/2016/02/26/improving-rtklib-solution-ar-lock-count-and-elevation-mask/
    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
    David

    Like

    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.

      Like

  9. 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

    Like

      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

        Like

Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.