im new to game programming and have a quick question. how do you add OpenGl, linux and other ports. its kind of hard to explain but what im trying to say is that how can you link all these together for certain comps. and other options for different comps.

You know, usually when questions go unanswered, it is because of one of several reasons:

1) No one who read it knows the answer, or2) No one who read it understands what you are asking.3) The question asked requires an extremely lengthy reply.

It is NOT (as you have obviously assumed) because people are just being jerks.

In this case, I think it's probably a combination of the last 2.

I'll try to briefly address your question. To port a game to another platform usually is not a trivial matter, which is why it doesn't happen with every game. Rather than getting into details about how to make this easier, I'll just say that it is going to be virtually impossible to make a game of any degree of complexity that will compile with any compiler on any platform. You would need several different versions of the code and supporting files.

Adding support for more than one API (eg. DirectX and OpenGL), is not as hard. You just need to write wrapper functions or classes that hide the API-specific details and call the appropriate functions based on which API the user has selected.