No were in my code i've included cstdio.h... Don;t know where's that coming from
Ah, but you #include <string>, which is a C++ standard header. Perhaps you wanted to #include <string.h> instead.
Anyway, you are using C, yet you are using C++ stuff like std::string.
Seriously, that code needs to rego a big change and either you need to learn C or stick to learning C++, because this code cannot compile as C (namespaces aren't supported in C either).
IMO they woudl get better performance by multithreading the compile. FileA can be compiled in parallel with FILEB, the linker stage would probably still need to be serial, but not compilation.
Visual Studio is terribly slow with large projects but is reported to be faster than most other compilers. Pre-compiled headers are far more headache than they are worth which is why at home I don't use them and we also do not use them at work.
I've noticed that even on a quad-core machine VS2003 and VS2005 take one core up to 100% and leave the other three at 0%. The compile is multithreaded insofar as you can still interact with the GUI but I seriously doubt if the compile process itself is multi-threaded. It 'appears' to be one thread.
Honestly, i think the whole multithreading thing kind of caught most companies by surprise, it was never a serious technique until multi-core made it give huge performance increases. Now I see hundreds of black box 'turn yoru serial code into parallel code without having to think' solutions. OpenMP, RapidMind, CUDA, although the last 2 are really for use with GPU's its only a matter of time before CPU's support native vector processing. I wouldn't mind, but I end up having to evaluate every new flavor of the month and then explain to the suit why it wont improve our applications or reduce development time (it mostly has to do with some internally closed source libraries that he wont let me get the code to so I can't optimize them).
The only real reason I can see to use PCH is to obfuscate a distributed LIB so thay cant even see your class structure.
I think somewhere both of you have had bad experiences, because I really don't get what you do.
PCH speeds up compiles greatly. You just have to include windows.h and you'll notice how fast it gets. 30 seconds is a big deal if you ask me.
PCH are not difficult to use and they are not error prone (at least not to me). I haven't received any problems with them pretty much in any project I have. Just don't include headers that keep on changing. Only static non-changing headers go there and you should have no problems whatsoever.
So far as I know, VS can only do multi-threaded compile with different projects, because I really have been unable to get it compiling on anything else than one core in one project.
Yeah I know it only uses a single thread, I was just saying they would get better performance increases by going MT than by saddling us with PCH. 30 seconds on a 2 minute compile is nothing, since Im going to get a water and bull........ with a collegue anyway.
Yes, MT with a single project would be great. Additionally, I think there is something along the lines of that, or should be, but I've never gotten something like that to work.
In this case your not slacking, your code is compiling. Just like the shirt says. :DQuote:
...since Im going to get a water and bull........ with a collegue anyway.
What you see above is a C++ style, converting into C ...Code:
HWND CreateButton(const HWND hParent,const HINSTANCE hInst,DWORD dwStyle,
const RECT& rc,const int id,const ustring& caption)
... gives a warningCode:
Ignoring this warning disables the minimize/restore/close buttons on the window... Any ideas on how to convert this properly?Code:
warning C4312: 'type cast' : conversion from 'int' to 'HMENU' of greater size