Worked fine with new compilers.
How do I do it if the driver.cpp was compiled by gcc with extension .o and the function.cpp was compiled by some old compiler with extension .obj ?
When I tried to link with g++.exe it said file format not supported.
Thanks in advance.
There are more than one way to create object files (the things containing compiled code that will be linked into an executable). Microsoft and GNU do it different ways, and while the code is the same, the file formats are not compatible.
But the main problem is that the C++ Standard does not mandate name mangling rules, so MS and GNU do it differently. Meaning that unless your obj file has a C interface, it is unlikely that you can get it to work easily.
That said, it believe it can be done. (I just don't know how.)
Is it not possible to recompile the obj from sources?
Or can you not just use VC++ to compile the whole thing?