VS2013 some issues to be aware of using rtklib (compile)

Source: Internet
Author: User

Recently, because the project needs to decode the RTCM data, Rtklib provides a number of lower-level functions that are ready to be directly exported to the standard DLL for C # invocation. Below the project reference Rtklib source code needs to note the place.

1. First create a new Win32 DLL project in vs2013

2. Add a folder to the project [RTKLIBSRC] and then "add an existing item" to the folder, adding the Rtklib source file to the project. Build Rcv under Rtklibsrc Rcv The following files are also added to the project

3. Now start compiling the project and you will find a lot of mistakes. Let's take a step closer to solving the error.

1> q:error C1853: The "debug\rtklibhelper.pch" Precompiled header file comes from an earlier version of the compiler, or the precompiled header is C + + and uses it in C (or vice versa) x:\xxxx\rtklibhelper\rtklibs RC\TLE.C 1 1 rtklibhelper
A: Do not use the precompiled header

2> Q: Error 1 Err C4996: ' strncpy ': This function or variable is unsafe. Consider using strncpy_s instead. To disable deprecation, use _crt_secure_no_warnings.    See online Help for details. X:\xxxx\rtklibhelper\rtklibhelper\rtklibsrc\tle.c

A: In fact, you are prompted to tell the method, you need to add a precompiled command to cancel this error [_crt_secure_no_warnings]

3> q:error C4996: ' gethostbyname ': Use Getaddrinfo () or getaddrinfow () instead or define _winsock_deprecated_no_warni NGS to disable deprecated API warnings x:\xxxx\rtklibhelper\rtklibsrc\stream.c

A: This error is similar to the above, join [_winsock_deprecated_no_warnings]

4> Q: Next is the error C2466: You cannot assign an array with a constant size of 0 x:\xxxx\rtklibhelper\rtklibsrc\rinex.c

A: This error let's take a look at [Maxprnglo] and press F12 to see his definition.

This constant is 0, so we can't compile, we want to add Enaglo to the precompiled compiler

5> q:error C1083: Cannot open include file: "Rtklib.h": No such file or directory X:\XXXX\RTKLIBHELPER\RTKLIBSRC\RCV\UBLOX.C 41 1 Rtklibhelper

A: Add additional directory settings [. \rtklibsrc], note that it is the general page of a C + +, not a linker.

6> q:error LNK2005: _INPUT_OEM3 has been defined in Novatel.obj x:\xxxx\rtklibhelper\novatel_old.obj rtklibhelper

A: This error is added to the file when added duplicate NOVATEL_OLD.C should not be added, delete can

7>: q:error LNK2019: unresolved external symbol _settspan, which is referenced _postpos x:\xxxx\rtklibhelper\postpos.obj in function rtklibhelper

Error LNK2019: unresolved external symbol [email protected], the symbol is referenced in function _tickget x:\xxxx\rtklibhelper\rtkcmn.obj rtklibhelper

Error LNK2019: unresolved external symbol [email protected], the symbol is referenced in function _accept_nb x:\xxxx\rtklibhelper\stream.obj rtklibhelper

A: Add additional libraries [connector, input, additional dependent libraries] add winmm.lib, Ws2_32.lib

8>:q:error LNK2019: unresolved external symbol _showmsg, which is referenced in function _convrnx x:\xxxx\rtklibhelper\convrnx.obj rtklibhelper

A: A check showmsg this function if in the DLL need to define their own, rtklib inside has done the processing need to add [DLL] in the preprocessor.

Inside the preprocessor we added

_crt_secure_no_warnings
_winsock_deprecated_no_warnings
Enaglo
Dll

Finally Rtklibhelper compiles successfully, can begin to write the concrete function function.

=========================================================================================

Diocp|mybean official website: primary domain: www.diocp.org

Diocp|mybean Official forum: http://delphi.net.cn

VS2013 some issues to be aware of using rtklib (compile)

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.