I have been developing a multiplatform (Linux and Windoze) 3D simulation/graphics/game engine for some time, and now need to be able to compile both 32-bit and 64-bit versions of the engine on 64-bit ubuntu linux, assuming that is possible.
I am somewhat confused about how the appropriate versions of include files, library files, and drivers all get matched properly. For example, when a 32-bit OpenGL application is running on a 64-bit Linux OS, where do 32-bit function calls cease and 64-bit function calls begin (to the driver, presumably)?
How do I make sure my programs include the appropriate include files (32-bit versus 64-bit)?
How do I make sure my programs link to the appropriate OpenGL and XWindows libraries (32-bit versus 64-bit)?
When I installed 64-bit ubuntu, it did not seem to install some of the OpenGL or X11 include files and library files. Do I need to explicitly install the nVidia drivers to make these install? Since the ubuntu package installation process appears to have installed the nvidia driver correctly (glxgears is fast), can I simply install these files manually (with the --extract-only option in the nvidia driver, then copy to the appropriate places)? This appears to save me from having to perform some kind of complex compilation process of one or more of the driver components.
If anyone can give me an overall description of the pieces of this puzzle, and where the 32-bit and 64-bit mismatch is taken care of, I'd greatly appreciate that. I hate not understanding what's going on around me. I cannot get my programs to compile properly on 64-bit ubuntu linux (either as 32-bit or 64-bit programs). As 32-bit programs CodeBlocks compilation says it can't find lX11 (during the link process, obviously). I'm not sure what makes CodeBlocks link in the appropriate libraries (32-bit versus 64-bit). I have -m32 and -m64 switches to the compiler and linker, hoping that tells them my intention, but who knows what else it might need (or whether my computer even has both 32-bit and 64-bit sets of every library my code requires (which is only rt, GL, X11 plus the standard C libraries at the moment).
Thanks for any help you can give!