Can you suggest what factors can cause an C++ Builder's 2009 linker error "Unresolved external '__fastcall System::TObject::NewInstance(System::TMetaClass *)' referenced from XXX.obj"?
We have a set of Delphi files (pas) and set of C++ Builder files (hpp and obj), which was generated from these pas files.
Set of files is copied to another machine. Both machine has the very same C++ Builder 2009 version with the same updates (latest: 3+4) installed.
When I create an empty VCL application in C++ Builder on other machine and include one obj file from this set to the active project, I get the above mentioned error at linking stage.
The strange things about this error are:
- This error can be reproduced not on every machine or C++ Builder installation (I've checked at least 5 of them).
- If you remove obj-file and instead add corresponding pas file to the project - the error will dissappear.
- But if you remove pas-file and include obj-file again - there will be no error.
- None of the obj of pas files gets modified in the process. I.e. if you delete this set of files from the machine and bring them from the first machine again (where they were created) - you still will have no error.
- Once you do that sequence on one particular machine (include/exclude pas-file from the project) - you can not longer get this error on that machine, no matter how hard you try (move files between folders, playing with settings, etc, etc). Actually, I already have no machines, where I can reproduce this error right now :(
I do not see, how situation "after" is different from situation "before" (after/before inclusion of pas-file), so error is visible only before and not after.
The only mention of this error (or a very similar error) on the internet is this. But there is no solution. There are no "+" chars in the path nor spaces (" ").
Am I missing something? Right now it looks like C++ Builder bug to me.
Any ideas would be appreciated.
P.S. We can not use "just include pas-file" solution, as we need to deploy only hpp+obj (no pas-files) at certain machines.