Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WBToolbox not building in robotology-superbuild on Windows #226

Closed
RAR1989 opened this issue Jul 8, 2019 · 8 comments
Closed

WBToolbox not building in robotology-superbuild on Windows #226

RAR1989 opened this issue Jul 8, 2019 · 8 comments

Comments

@RAR1989
Copy link

RAR1989 commented Jul 8, 2019

I tried to build the robotology-superbuild on Windows starting from a clean build, however it always failed. I got the error below:

 Build files have been written to: C:/Users/rromeo/devel/robotology-superbuild/build/robotology/WBToolbox
8>Performing build step for 'WBToolbox'
8>Microsoft (R) Build Engine version 16.1.76+g14b0a930a7 for .NET Framework
8>Copyright (C) Microsoft Corporation. All rights reserved.
8>
8>  ClockRpc.vcxproj -> C:\Users\rromeo\devel\robotology-superbuild\build\robotology\WBToolbox\lib\Release\ClockRpc.lib
8>  WBToolboxBase.vcxproj -> C:\Users\rromeo\devel\robotology-superbuild\build\robotology\WBToolbox\lib\Release\WBToolboxBase.lib
8>  Auto build dll exports
8>     Creating library C:/Users/rromeo/devel/robotology-superbuild/build/robotology/WBToolbox/lib/Release/WBToolbox.lib and object C:/Users/rromeo/devel/robotology-superbuild/build/robotology/WBToolbox/lib/Release/WBToolbox.exp
8>SimulatorSynchronizer.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const blockfactory::core::BlockOptionPrioritizeOrder" (?BlockOptionPrioritizeOrder@core@blockfactory@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B) referenced in function "public: virtual class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl wbt::block::SimulatorSynchronizer::additionalBlockOptions(void)" (?additionalBlockOptions@SimulatorSynchronizer@block@wbt@@UEAA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ) [C:\Users\rromeo\devel\robotology-superbuild\build\robotology\WBToolbox\toolbox\library\WBToolbox.vcxproj]
8>C:\Users\rromeo\devel\robotology-superbuild\build\robotology\WBToolbox\bin\Release\WBToolbox.dll : fatal error LNK1120: 1 unresolved externals [C:\Users\rromeo\devel\robotology-superbuild\build\robotology\WBToolbox\toolbox\library\WBToolbox.vcxproj]
8>Done building project "WBToolbox.vcxproj" -- FAILED.

cc @traversaro @diegoferigo @nunoguedelha @isorrentino

@diegoferigo
Copy link
Member

It is a problem about global variables in Windows using VS compiler. We already encountered it in the past I think with @bemilio robotology/blockfactory#44. The fix however still didn't go upstream.

@isorrentino
Copy link

@diegoferigo, @RAR1989 and I tried the solutions suggested in the issue you linked but they did not work.

cc @drdanz

@diegoferigo
Copy link
Member

If @bemilio has still access to the PC where we fixed it, maybe you can check what we did. I don't remember exactly the patch I applied.

@bemilio
Copy link
Contributor

bemilio commented Jul 9, 2019

I remember we finally managed to complete the installation. The only thing not working was the WBToolbox-MATLAB integration.

I am not sure what we should check on the monster. Maybe the global variables? I remember that in solving this issue I didn't understand much of what was going on and that in the end Diego and silvio managed to solve it. But I have no idea what the steps were.

The PC was the monster and it is still available, just as far as I understand @isorrentino proceeded in cleaning the build, so I don't know the status of the PC anymore

@drdanz
Copy link
Member

drdanz commented Jul 10, 2019

We managed to build the superbuild with @RAR1989, and we found a few issues in several projects.

  1. blockfactory is built with the CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS that as explained in the WINDOWS_EXPORT_ALL_SYMBOLS property documentation requires to use __declspec(dllimport) in order to import global symbols from the dll (in this case the symbol is blockfactory::core::BlockOptionPrioritizeOrder). We fixed this by changing in blockfactory/sources/Core/include/BlockFactory/Core/BlockInformation.h (this is obviously not a good fix because it won't work on linux)
+extern const std::string BlockOptionPrioritizeOrder;
-extern __declspec(dllimport) const std::string BlockOptionPrioritizeOrder;
  1. qpOases and blockfactory have a broken FindMatlab.cmake file, applying the fix proposed in the upstream issue on all the files worked.

  2. the yarp-matlab-bindings has 2 files Vocab.m and VOCAB.m in the same directory. As a consequence the update step fails. In order to fix this we disabled the update step by enabling the DEVEL_MODE for the project. I cannot guarantee that this will not cause other issues.

@diegoferigo
Copy link
Member

Thanks @drdanz for taking care of that. I'll take care of blockfactory as soon as I'll be back to IIT and have access to a Windows machine.

@traversaro
Copy link
Member

the yarp-matlab-bindings has 2 files Vocab.m and VOCAB.m in the same directory. As a consequence the update step fails. In order to fix this we disabled the update step by enabling the DEVEL_MODE for the project. I cannot guarantee that this will not cause other issues.

This was fixed in robotology/yarp-matlab-bindings#43 .

@traversaro
Copy link
Member

1. `blockfactory` is built with the [`CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS`](https://cmake.org/cmake/help/latest/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.html) that as explained in the [`WINDOWS_EXPORT_ALL_SYMBOLS`](https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html) property documentation requires to use `__declspec(dllimport)` in order to import global symbols from the dll (in this case the symbol is `blockfactory::core::BlockOptionPrioritizeOrder`). We fixed this by changing in `blockfactory/sources/Core/include/BlockFactory/Core/BlockInformation.h` (this is obviously not a good fix because it won't work on linux)
+extern const std::string BlockOptionPrioritizeOrder;
-extern __declspec(dllimport) const std::string BlockOptionPrioritizeOrder;

This was fixed by robotology/blockfactory#54 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants