Plugin on Windows 10 after upgrade

Typically: "How do I... ", "How can I... " questions
Post Reply
napoleon
Posts: 19
Joined: 12 Dec 2019, 11:03

Plugin on Windows 10 after upgrade

Post by napoleon »

Hi!

First of all, thank you for providing a great software!

I've been developing a plugin for an earlier version of CoppeliaSim on Windows 10. I recently upgraded and found that my plugin would no longer compile. To analyze why, I downloaded the new plugin skeleton to see if that would compile which it didn't. I think the main reason is that I now need xsltproc which I can't get to run on windows.

My temporary solution is to use the old libPlugin to compile my plugin which works well but does not seem like a long term solution. I want my plugin to be compatible with new versions of CoppeliaSim and if I decide to create a new plugin I want to be able to use the new plugin framework. Also, the new plugin skeleton does not compile with the old libPlugin, suggesting to me that missing xsltproc is not the only thing that I would have issues with when going between versions.

Do you have any suggestions as to how to proceed? Moving over to Linux is not an option.

fferri
Posts: 821
Joined: 09 Sep 2013, 19:28

Re: Plugin on Windows 10 after upgrade

Post by fferri »

You should be able to easily install xsltproc with chocolatey or other package managers.

You can also install it manually: an old binary is provided here and it should work also on Windows 10.

It would be better to see the actual build errors you got, to better help you fix the problems.

napoleon
Posts: 19
Joined: 12 Dec 2019, 11:03

Re: Plugin on Windows 10 after upgrade

Post by napoleon »

Thanks for the quick response.

When I clone SimExtSkel and try to compile I get the following error message

Code: Select all

>------ Build All started: Project: simExtSkelVanilla, Configuration: x64-Debug ------
  [1/8] Generating generated/stubs.cpp, generated/stubs.h, generated/plugin.h, generated/stubsPlusPlus.cpp, generated/index.json, generated/reference.html, generated/lua_calltips.cpp, generated/simSkel-typecheck.lua
  FAILED: generated/stubs.cpp generated/stubs.h generated/plugin.h generated/stubsPlusPlus.cpp generated/index.json generated/reference.html generated/lua_calltips.cpp generated/simSkel-typecheck.lua 
  cmd.exe /C "cd /D ......\simExtSkelVanilla\out\build\x64-Debug && C:\ProgramData\Anaconda3\python.exe "C:/Program Files/CoppeliaRobotics/CoppeliaSimPro/programming/libPlugin/simStubsGen/generate.py" --verbose --xml-file ....../simExtSkelVanilla/callbacks.xml --gen-all ....../simExtSkelVanilla/out/build/x64-Debug/generated --lua-file ....../simExtSkelVanilla/simSkel.lua"
C:\Users\46705\Source\Repos\simExtSkelVanilla\out\build\x64-Debug\EXEC : warning : missing python package "xmlschema"; input file callbacks.xml will not be validated.
C:\Users\46705\Source\Repos\simExtSkelVanilla\out\build\x64-Debug\EXEC : warning : missing python package "xmlschema"; input file callbacks.xml will not be validated.
  "C:/Program Files/CoppeliaRobotics/CoppeliaSimPro/programming/libPlugin/simStubsGen/generate.py" --verbose --xml-file ....../simExtSkelVanilla/callbacks.xml --gen-all ....../simExtSkelVanilla/out/build/x64-Debug/generated --lua-file ....../simExtSkelVanilla/simSkel.lua
  C:\ProgramData\Anaconda3\python.exe "C:\Program Files\CoppeliaRobotics\CoppeliaSimPro\programming\libPlugin\simStubsGen\generate_lua_xml.py" ....../simExtSkelVanilla/callbacks.xml ....../simExtSkelVanilla/simSkel.lua ....../simExtSkelVanilla/out/build/x64-Debug/generated\lua.xml
  C:\ProgramData\Anaconda3\python.exe "C:\Program Files\CoppeliaRobotics\CoppeliaSimPro\programming\libPlugin\simStubsGen\merge_xml.py" ....../simExtSkelVanilla/callbacks.xml ....../simExtSkelVanilla/out/build/x64-Debug/generated\lua.xml ....../simExtSkelVanilla/out/build/x64-Debug/generated\reference.xml
  xsltproc -o ....../simExtSkelVanilla/out/build/x64-Debug/generated/reference.html "C:/Program Files/CoppeliaRobotics/CoppeliaSimPro/programming/libPlugin/simStubsGen/xsl/reference.xsl" ....../simExtSkelVanilla/out/build/x64-Debug/generated/reference.xml
  failed to run xsltproc
  ninja: build stopped: subcommand failed.

Build All failed.

fferri
Posts: 821
Joined: 09 Sep 2013, 19:28

Re: Plugin on Windows 10 after upgrade

Post by fferri »

Installing xsltproc will fix the build error.

napoleon
Posts: 19
Joined: 12 Dec 2019, 11:03

Re: Plugin on Windows 10 after upgrade

Post by napoleon »

Thanks, installing xsltproc through chocolatey got me part way there.

However, when I build a project created for the previous version of CoppeliaSim I get the error below.

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2001	unresolved external symbol "public: virtual void __cdecl sim::Plugin::onScriptStateDestroyed(int)" (?onScriptStateDestroyed@Plugin@sim@@UEAAXH@Z)	....\source\repos\SimSwitchThread\out\build\x64-Debug\SimSwitchThread	....\source\repos\SimSwitchThread\out\build\x64-Debug\plugin.cpp.obj	1	

napoleon
Posts: 19
Joined: 12 Dec 2019, 11:03

Re: Plugin on Windows 10 after upgrade

Post by napoleon »

Solved that by using coppeliasim_add_plugin instead of add_library in CMakeLists.txt.

However, now I'm getting things like

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "void __cdecl createContext(struct SScriptCallBack *,char const *,struct createContext_in *,struct createContext_out *)" (?createContext@@YAXPEAUSScriptCallBack@@PEBDPEAUcreateContext_in@@PEAUcreateContext_out@@@Z) referenced in function "void __cdecl createContext(struct SScriptCallBack *,struct createContext_in *,struct createContext_out *)" (?createContext@@YAXPEAUSScriptCallBack@@PEAUcreateContext_in@@PEAUcreateContext_out@@@Z)	....\Source\Repos\CoppeliaSimLiftWithIK\out\build\x64-Debug\CoppeliaSimLiftWithIK	....\Source\Repos\CoppeliaSimLiftWithIK\out\build\x64-Debug\stubs.cpp.obj	1	
The function createContext(struct SScriptCallBack *,char const *,struct createContext_in *,struct createContext_out *) is defined in plugin.cpp.

fferri
Posts: 821
Joined: 09 Sep 2013, 19:28

Re: Plugin on Windows 10 after upgrade

Post by fferri »

Please show the relevant part of CMakeLists.txt and plugin.cpp

napoleon
Posts: 19
Joined: 12 Dec 2019, 11:03

Re: Plugin on Windows 10 after upgrade

Post by napoleon »

I was not including the sources correctly in coppeliasim_add_plugin.
Now that I use coppeliasim_add_plugin(simExtCoppeliaSimSkanskaLiftWithIK SOURCES ${SOURCES} src/plugin.cpp) where SOURCES contain my files things are working.

Thank you so much for your help.

Post Reply