see if i have made one c program in c on linux machine now if i want to compile that program on other os or lets say on windows how can i do that.?
what if i have used os specific things like pthread.h, in that program.?
Is there any direct way to do so.?
Then I hope you were paying attention which APIs are available on Windows and which are not. This is not an easy problem to solve.
As you have used
pthreads, there is no API-compatible replacement on Windows. The native API isCreateThreadand its children. If you must maintain source level compatibility, you either create your own#ifdefrules, wrapper, or use a third party library like APR.