Hi
I have a project made in c++ in qt creator now i have to compile a .c file with this. How to compile this.
I tried it with adding "add existing file" file but it is not getting file.
Hi
I have a project made in c++ in qt creator now i have to compile a .c file with this. How to compile this.
I tried it with adding "add existing file" file but it is not getting file.
As a C++ compiler can treat most anyrhing written in C as C++, you can probably just change your file suffix from .c to .cpp. You may meet some errors and warnings related for example value casts, but fixing those is easy and will increase the robustness of the code.
For me it works.
A camel can go 14 days without drink,
I can't!!!
if you want to compile using C compiler (gcc command), use .c extention for the files added to Qt project
if you want to compile using C++ compiler (g++ command), use .cpp extentions for the files added to Qt Project
What to mean by "not getting file"?Originally Posted by Niamita
Edit: Note, this is applicable if you use gcc, (similar is applicable to most compilers, at least all the compiler which I used), in case this does not work, check your compiler documentation.
extern "C"{
#include "header.h"
}
I think
Bookmarks