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

error running test_cxxwrap.cpp in Julia 1.9.2 #380

Open
mind6 opened this issue Oct 10, 2023 · 2 comments
Open

error running test_cxxwrap.cpp in Julia 1.9.2 #380

mind6 opened this issue Oct 10, 2023 · 2 comments

Comments

@mind6
Copy link

mind6 commented Oct 10, 2023

I used MSBuild version 17.7.2 and cl.exe to build libcxxwrap-julia on Windows, then I set ~.julia\dev\libcxxwrap_julia_jll\override to point to its build directory. I can get a hello world function like this to work:

#include <string>
#include <jlcxx/jlcxx.hpp>

std::string greet()
{
   return "hello, world";
}

JLCXX_MODULE define_julia_module(jlcxx::Module& mod)
{
  mod.method("greet", &greet);
}

But any one of the tests test_cxxwrap, test_module, test_type_init in \libcxxwrap-julia\test produces the following message:

C++ exception while wrapping module StdLib: Symbol for type CppBasicString was not found. A Value of type null was found instead. Searched modules: Main Base Base
InitError: Symbol for type CppBasicString was not found. A Value of type null was found instead. Searched modules: Main Base Base
during initialization of module StdLib

I'm not sure what's happening exactly. libcxxwrap-julia was built against the pre-built Julia binary in my "program files" directory. Should this be working? Should I try another version of Julia? Do I need to build Julia from source?

@mind6
Copy link
Author

mind6 commented Oct 11, 2023

I found this problem only occurs in vscode prompt with CMake Tools extension active. test_cxxwrap.exe works in any other Windows prompt, works in Windows explorer, and also works within Visual Studio 2022 IDE.
Maybe this is a lower priority setup issue. I'd still like to know what I should be looking for to understand why it's having this problem in vscode?

@barche
Copy link
Collaborator

barche commented Oct 21, 2023

I have tested using vscode on my machine, and at least the ctests work, provided I set the override correctly. On Windows, it may be easier to use the Overrides.toml method (see end of the libcxxwrap-julia Readme). You also need to have the Julia bin dir in your path, but I don't think that's the problem here, the error you see appears when binaries compiled with different compilers are mixed.

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

2 participants