Issues and Workarounds for RTKPLOT_QT version compilation in the Windows environment

Source: Internet
Author: User

After using the Rtklib open source package with the Rtkplot.exe, know what it has the function, just think how to imitate it to make a demo. At the beginning of the 2.4.2 version of Rtklib, which was previously downloaded, was developed using Delphi. Since I am familiar with Qt Now, I would like to use the QT framework to develop this demo. In the process of looking at the source code, quirks again to the official network again downloaded a source package, the results found that the latest 2.4.3 version of the QT implementation with the relevant app program. In this way, you can directly read the ready-made QT source code. But the first thing to solve is to try to compile the given source code successfully.

1. Open the Rtkplot_qt.pro file directly in Qt Creator, configure the project properties and enter the normal working interface. debugging directly, the following error is reported.

Figure 1

At first, I thought it was VS2015. In the installation of the problem, the Internet to find the solution is also said to configure the environment variables. In fact, it has been explained what the problem, is the Src\debug directory is missing LIBRTKLIB.A file .

2.. a file is a static library file under a Linux system, similar to a. lib file under Windows system; Similarly, the. So file under the Linux system is a dynamic-link library file, equivalent to a. dll file under the WinDOS system. In addition, before reading the source of the RTKPLOT_QT found that in fact, many of the data and algorithm code is using the corresponding code under SRC, so these visualizations are required to call the SRC Library code. The invocation is done by compiling the source code in SRC into a static link library for use by these visualizations. This is reflected in the Rtkplot_qt.pro file, as shown in.

Figure 2

3. Now that you know the problem is the missing LIBRTKLIB.A file in the Src\debug directory, try to find the LIBRTKLIB.A file and place it in the directory. Open the folder, found in the SRC directory there is no debug folder, so we will first create a new debug folder . Then the entire Rtklib source package search for LIBRTKLIB.A files, the results are not found. Since there is no ready-made, it may be necessary for us to make a LIBRTKLIB.A file .

4. Previously said, LIBRTKLIB.A file is the SRC source code compiled into a static link library file, and the SRC folder just have a Src.pro file. Open the file and find the code as shown

Figure 3

The code in this article means that the purpose of this QT project is to generate a static link library file named Rtklib. However, it is important to note that the. lib file is generated under Windows system! Debug the project directly and report the following error

Figure 4

After reviewing the compilation information as shown, it is found that the problem should be caused by the invalid compilation parameter "-wno-unused-but-set-variable". Baidu, the original intent of the compilation parameter is to ignore those settings and not used parameters, but as shown in the wording seems to have a problem, should be changed to Figure 7 as shown in the wording.

Figure 5 Errors caused by the compilation parameter "-wno-unused-but-set-variable"

Figure 6 Compilation parameter "-wno-unused-but-set-variable" the original way of writing

Figure 7 The correct way to write after the compilation parameter "-wno-unused-but-set-variable" is modified

5. Clear the original project after the execution of Qmake, and then re-debug once again, you can run successfully, pop up the dialog box shown below.

Figure 8

At first I was also very confused, I will pop up this interface. I know this interface is equivalent to C + + console program can be the command line to the main function main pass parameters, but the SRC folder there is no main function, inside the function is the source code, and do not call these source functions. Baidu later found that this is because the project itself is to compile a static library file, the project does not have an executable main function, so it will pop up this interface to select executable program and input parameters. As for the required static link library file LibRTKLib.lib, it has been generated in the Build-src-desktop_qt_5_8_0_msvc2015_64bit-debug\debug directory. Copy the file to the Src\debug directory , and before recompiling the RTKPLOT_QT project, you need to change the code in Figure 2 to show. This is because the static library that is generated now is a. lib file, and the source environment may be a Linux system, so the. A file is used. The code needs to be modified slightly.

Figure 9

After clearing the Qmake, and then re-debugging, will report the following error

Figure 10

6. for the first two errors, directly in the Plotcmn.cpp file to use the function of the error, and then add a third parameter ndec is possible. The third error is to redefine the string pointer array name as a constant string pointer array (const char*). After the changes are compiled again, the following error is reported.

Figure 11

This problem is very strange at first, because the newspaper "unresolved external symbols" is generally a problem with the link library, and we have previously added the link library file libRTKLib.lib. At first I did not know to compile the LibRTKLib.lib file, once the code in Figure 2 directly commented out, want to try the program can not run, the results reported a lot of "unresolved external symbols" problem. The problem is now also reported after the link library has been added, but only the two "unresolved external symbols" are reported. Is it true that LibRTKLib.lib does not contain the functions of input_tersus and INPUT_TERSUSF? After finding the two functions are found in the SRC/RCV/TERSUS.C file, open the Src.pro file, found that its sources really only missing tersus.c this file. After you add the file in sources, recompile the static library file for the SRC project . Replace the second obtained libRTKLib.lib with the corresponding file in the Src/debug directory.

7. Rerun the RTKPLOT_QT project and you can run it successfully. The result of the operation is as shown

Figure RTKPLOT_QT the main interface after successful operation

Bingo!

Issues and Workarounds for RTKPLOT_QT version compilation in the Windows environment

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.