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

Getting compilation errors when using modules #215

Open
ghost opened this issue Nov 15, 2023 · 3 comments
Open

Getting compilation errors when using modules #215

ghost opened this issue Nov 15, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@ghost
Copy link

ghost commented Nov 15, 2023

Hi!

I am getting the following compilation error when using certain part of your package inside a module;

Relevant Code:
selenium_bindings.h++

module;

#include <string>

#include <jni.h>
#include <jni_bind.h>

using namespace std;
using namespace jni;

export module selenium_bindings;

export constexpr Class FirefoxDriver {
    "org/openqa/selenium/firefox/FirefoxDriver",
    Constructor()
 };

export class NPC {
private:
    LocalObject<FirefoxDriver> ffxDriver;

public:
    NPC() {
    }

    virtual ~NPC() {
    }
};

main.cc

// inside main
NPC npc("", "");

getting the following error:

/nix/store/9ysy4d521yfhg7x81fkw0vq2kaqcyix5-jnibind-0.9.8/include/jni_bind.h:2377:25: error: 'jni::metaprogramming::StringAsType::static_chars' from module 'selenium_bindings.<global>' is not present in definition of 'StringAsType<chars...>' provided earlier
  static constexpr char static_chars[] = {chars..., 0};
                        ^
/nix/store/9ysy4d521yfhg7x81fkw0vq2kaqcyix5-jnibind-0.9.8/include/jni_bind.h:2377:25: note: declaration of 'static_chars' does not match
  static constexpr char static_chars[] = {chars..., 0};
                        ^
1 error generated.

using:

clang version 16.0.6
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /nix/store/dl48w741h1pbpyzyd4aaq18pr2hvv00y-clang-16.0.6/bin
@jwhpryor
Copy link
Collaborator

Thanks for the bug report! Is this new with 0.9.8 or was this your first time trying it and it failed?

@ghost
Copy link
Author

ghost commented Nov 16, 2023

First time trying it out.

@jwhpryor
Copy link
Collaborator

Sorry for the lack of update. I want to clear out some outstanding issues for a 1.0 release first, however, I did notice that modules support seems to be an active discussion here;

bazelbuild/bazel#19940

I tried briefly to play with this myself but frustratingly I couldn't get them to work with Bazel.

@jwhpryor jwhpryor added this to the Release 2.0 milestone Mar 18, 2024
@jwhpryor jwhpryor added the enhancement New feature or request label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant