google / google/jni-bind

Getting compilation errors when using modules

Open
#215 4 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
333
Forks
40
PR merge metrics
No merged PRs in 30d

Description

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

#include
#include

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 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.' is not present in definition of 'StringAsType' 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.