Quote Originally Posted by Grumpy View Post
hummmm, I did some test and i figured out the problem is to try using Qt in my C files. In a Qt project with one only C files (classic Hello world) if include Qt it returns error, if a rename the file in C++ it is all ok.
So the problem was that the file was being compiled by the C compiler which then chocked on the C++ stuff.

Quote Originally Posted by Grumpy View Post
So, the ways I thought are:
1_convert all my file C in C++...I hope no
Only necessary if you use C++ in these files.

Quote Originally Posted by Grumpy View Post
2_convert the main.c in main.cpp, solve the problem of conversion and call the other C file putting extern when the header is called....hoping the extern works.
Don't see why not, this is how C libraries get called after all

Quote Originally Posted by Grumpy View Post
3_create a simple new main file in c++ then call all the other files with extern as above
I guess that also works.

Quote Originally Posted by Grumpy View Post
Sorry, I don't get what you say? How should I specified the Qt library to use?
Well, an include doesn't have anything to do with a library being used, but if you meant how to use Qt classes, then the best way is to include the headers for those you actually need.

A module header requires the compiler to read and parse all headers of the module, increasing the build time for no gain.

Cheers,
_