1
General / Need help in creating a .dll/.so from .obj files?
« on: March 02, 2015, 09:07:55 am »
I don't want to do a long post on my question. I already done my research on how C++ compiles the code we write and after compilation phase, it gives .obj files which is passed to the linker to become an executable (i.e. .exe) or a shared library (.dll/.so). Now having this knowledge, I wanted to create a simple .cpp and .hpp file, get the .obj for this files and generate the .lib or .so for this project. I want it not tied to any platform, compiler, or IDE, unless it really can't be helped. Is this a complicated process that needs heavy study and research?
I also found out Cmake files used to generate project templates so it can be loaded to an IDE. It generates the library file (both static and dynamic) appropriate with the IDE, Compiler and the Platform I am using (.dll for Windows) which I used to develop games with. But I don't know how to do similarly for my project.
I hope you can enlighten me with steps after having .obj files and turning this into .dll/.so. Do I need a specific configuration that tells my whatever IDE or compiler that they are building a library not binary? Such that when I press the compile button on whatever IDE it produces the .lib/.so on the bin folder. I have seen library templates on both CodeBlocks and VSE, but I think this will not help me achieve what I wanted to do by tying my code to the IDE and Compiler I am using.
I hope you could provide me insights and enlightenment on this topic. Also, please correct me if I got the wrong perspective. Thank you.
I also found out Cmake files used to generate project templates so it can be loaded to an IDE. It generates the library file (both static and dynamic) appropriate with the IDE, Compiler and the Platform I am using (.dll for Windows) which I used to develop games with. But I don't know how to do similarly for my project.
I hope you can enlighten me with steps after having .obj files and turning this into .dll/.so. Do I need a specific configuration that tells my whatever IDE or compiler that they are building a library not binary? Such that when I press the compile button on whatever IDE it produces the .lib/.so on the bin folder. I have seen library templates on both CodeBlocks and VSE, but I think this will not help me achieve what I wanted to do by tying my code to the IDE and Compiler I am using.
I hope you could provide me insights and enlightenment on this topic. Also, please correct me if I got the wrong perspective. Thank you.