Much of my code depends on a proprietary Windows library in .lib format (static library). Lets call it prop.lib.
The library works such that I make a new shared library that links to prop.lib. I can then run my code through prop.exe (another program that loads my shared library and runs my code).
I want to create an executable that runs on it's own, but since prop.lib includes a main function, I get a linker error.
Is it somehow possible to remove the main function from the lib or create another entry point?
I use Visual Studio 2005.
EDIT: As of now I do not have the source code for prop.lib.
You should realize that this is rather low level task.
Work around: If you have acces to build configuration to your executable you can specify linker option /ENTRY in your executable build.
Microsoft's editbin doesn't allow to perform such modification. So it seems that there is not exist official method to "hack" your *.obj files from Microsoft
Try to view in object files in your static library with lib /list staticlib.lib If you're lucky and you have main.obj in separate object files,then just /remove that object file
If 3 doesn't help try It yourself to write application to edit symbols in COFF files. https://msdn.microsoft.com/en-us/windows/hardware/gg463119.aspx
From start of the object file pass +8bytes, read 4 bytes. It will be offset to table with "18 bytes structures with names. (if all names are then 8 bytes long)". Edit needed names with padding residual "name" bytes with zeros. I never try to work with COFF. I can't find anything like COFF editor in the web.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With