Hi all,
I’m just diving into making my first cpp TOP in order to grab frames from a high speed camera (a PixeLINK) in to touch.
I can’t get touch to open the .dll, however, as I’m getting a “.dll is missing required functions” error. I’d assume this means I didn’t override some pure-virtual functions, except that this error is being thrown when I compile the provided example of a CPUMemoryTOP.dll. In fact it happens with all the example VS project files I can compile.
They all compile successfully from VS (I am using 2017, but I’ve tried compiling from 2015 just in case, both fail), but TD throws the same error.
I’m using TD 16220 Commercial on Win10.
Camera data is working outside of the context of TD.
Thank you in advance
Hey,
The functions it’s unable to find are actually the 3 C functions: GetTOPPluginInfo, CreateTOPInstance and DestroyTOPInstance. Is the DLLEXPORT define getting defined correctly? If you look at your .dll with Dependency Walker [url]http://www.dependencywalker.com/[/url], can you see those functions exported?
Un-implemented pure virtual functions would result in a compile error when you compile, so that’s not the issue here.
Hi Malcom,
thanks for the reply.
The three methods are defined in the CPUMemoryTOP.cpp,
and surrounded by
extern “C”
{
(methods)
}
this is in the example project CPUMemoryTOP included with TD099.
I’ll check out dependency walker right now and see if that turns up anything.
The extern “C” will avoid C++ name decoration, but the define that actually exports the functions from the .dll is DLLEXPORT. I wonder if it’s being redefined somehow? I just tried compiling the sample project from that build and it worked for me.
Hmm, curious. So it’s particular to my setup.
I got the following output from Dependency Walker:
Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: A circular dependency was detected.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Also, to be clear, inside the extern designation, the three methods are correctly decorated with DLLEXPORT:
extern “C”
{
DLLEXPORT
TOP_PluginInfo
GetTOPPluginInfo(void)
{
TOP_PluginInfo info;
// This must always be set to this constant
info.apiVersion = TOPCPlusPlusAPIVersion;
// Change this to change the executeMode behavior of this plugin.
info.executeMode = TOP_ExecuteMode::CPUMemWriteOnly;
return info;
}
// etc .
}
Those warnings are normal. You should see the 3 exported functions in the right side, 2nd section from the top.
Screenshot attached
Weird. Can you attach the .cpp file here? Are you compiling for Release or Debug?
Sure. I’ve attached the CPUMemoryTOP.cpp.
I suspect it is identical to yours, and there is something wrong with the setup on my system.
Thank you for looking into it
CPUMemoryTOP.cpp (6.71 KB)
Ya that’s strange. Not sure whats going on there. Do you have another machine you can try on?
This happens in both Debug and Release
Yes, I’ll try a different machine next
This issue occurs on the 2nd machine.
Not sure what’s going on here.
Are you recompiling on the 2nd machine, or just using the .dll on it? Can you share the .dll. You may need to .rename it
I re-compiled it on the 2nd machine from source included with TD099 in VS2015
I’ve attached the dll to this post, CPUMemoryTOP.dll
That is the default name. Merely renaming CPUMemoryTOP.dll to another name has no effect on my machine.
No I mean you likely need to rename the .dll to a different extension to be able to attach it to the forum. Looks like it failed right now
oh heh! Yeah that makes sense. Malicious .dlls and all.
I’ve named it to .txt, hopefully that works.
CPUMemoryTOP.txt (34.5 KB)
UPDATE:
I just had someone with another machine who was able to successfully build and test the example dll on their machine which worked completely.
I copied that working .dll to my machine, and I got the error.
So the issue seems to not be with build, but with TD itself on my machine.
I just reinstalled TD and still experience the issue with a clean install.
offhand I feel like it’s a windows permission issue somehow…