There is really no way to do it cross-platform, but you can create .dll's and .a's separately for windows and linux. Not sure what the file extension is for Mac, as I don't use it, but it would function the same. If you are asking how to make them, you would link the .o files with g++ -shared ...other stuff.... Most IDEs have options to make .dll's.