Compile, connection

xiaoxiao2021-03-06  40

How to use .c files in VC projects (

Let the .C file can also be peaceful in VC project

) The VC project cannot be compiled. C is the file of the extension, but sometimes it is necessary to add a .c file in the project, what should I do?

Solution:

1. The Pre-Describe Options in the Project Compilation Settings are set to not use the pre-compiled head or automatically use the pre-translatable head, because .C files generally do not contain the stdafx.h file. Peoject -> Settings -> C / C -> Precompiled Headers -> Automatic Use of Precompiled Headers

2. Peoject -> settings -> C / C -> Project Options is in the bottom of the text box, manually add / TP option.

Note: The second step is to use the C function in the CPP file, and if you do not use the second step, you can use the EXTERN "C" {} when including the C function header file in the CPP. "XXX.H" Put {}.

转载请注明原文地址:https://www.9cbs.com/read-74054.html

New Post(0)