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

Compiling load_test on windows fails #4061

Closed
RickiNano opened this issue Jan 19, 2023 · 3 comments
Closed

Compiling load_test on windows fails #4061

RickiNano opened this issue Jan 19, 2023 · 3 comments
Assignees
Milestone

Comments

@RickiNano
Copy link
Contributor

RickiNano commented Jan 19, 2023

Summary

Using Visual studio 2019 to compile the current develop branch with the test projects included will fail with the following three error messages:
Error LNK2019 unresolved external symbol jump_fcontext referenced in function "public: void * __cdecl boost::coroutines::detail::coroutine_context::jump(class boost::coroutines::detail::coroutine_context &,void *)" (?jump@coroutine_context@detail@coroutines@boost@@QEAAPEAXAEAV1234@PEAX@Z) load_test C:\Users\***\Documents\NanoBinaries\nano\load_test\boost_coroutine.lib(coroutine_context.obj) 1 Error LNK2019 unresolved external symbol make_fcontext referenced in function "public: __cdecl boost::coroutines::detail::coroutine_context::coroutine_context(void (__cdecl*)(struct boost::context::detail::transfer_t),struct boost::coroutines::detail::preallocated const &)" (??0coroutine_context@detail@coroutines@boost@@QEAA@P6AXUtransfer_t@1context@3@@ZAEBUpreallocated@123@@Z) load_test C:\Users\***\Documents\NanoBinaries\nano\load_test\boost_coroutine.lib(coroutine_context.obj) 1 Error LNK1120 2 unresolved externals load_test C:\Users\***\Documents\NanoBinaries\Release\load_test.exe 1

The error seems to have appeared after the Boost link targets were changed in this commit:
d8fa4b7

Node version

v25db7

Build details

Build using these instructions:
https://github.com/nanocurrency/nano-node/files/10362594/Nano_windows_install.pdf
This has worked fine before

OS and version

Windows 10

Steps to reproduce the behavior

  1. Pull develop branch
  2. Run cmake and include test project
  3. open in VS2019 and compile

Expected behavior

No compile errors

Actual behavior

Three errors are outputted

Possible solution

It seems like it has something to do with boost coroutine.
Apparently the order that it is included matters: https://stackoverflow.com/a/17883184

Supporting files

No response

@RickiNano RickiNano changed the title Compiling test on windows fails Compiling load_test on windows fails Jan 19, 2023
@clemahieu
Copy link
Contributor

clemahieu commented Jan 19, 2023

Is this cross compiling from Windows on an Apple silicon chip to x64?

I've seen a similar issue but looking at load_test it seems like the only project with the issue. We added some boost coroutine functions in load test but they've been superseded by C++20 now.

In the mean time we should rewrite the boost::spawn and boost::yield_context code and replace it with standard callback code as is in the node elsewhere. This will remove the dependency on boost context entirely.

@RickiNano
Copy link
Contributor Author

It's not cross compiled. It's compiled on an Intel I7 8700K.

@qwahzi qwahzi added this to the Backlog milestone Jan 24, 2023
@thsfs thsfs self-assigned this Feb 2, 2023
@clemahieu clemahieu modified the milestones: Backlog, V25.0 Feb 2, 2023
@RickiNano
Copy link
Contributor Author

This issue has been resolved in current develop branch. Most likely because of this PR:
#4140

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

No branches or pull requests

4 participants