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: expression CONNECTION_INIT = CONNECTION_INIT().ordinal() is not a constant #1

Open
Ezneh opened this issue Jun 14, 2020 · 12 comments

Comments

@Ezneh
Copy link

Ezneh commented Jun 14, 2020

Hello,

While trying to follow the hunt-framework example, I get this error:
Error: expression CONNECTION_INIT = CONNECTION_INIT().ordinal() is not a constant

I am compiling on Windows 10, x86_64 architecture with ldc2 1.21.0 (using dub run).

@Heromyth
Copy link
Contributor

Heromyth commented Jun 16, 2020

Build the demo for AMQP with dub build --arch=x86_64 --build=debug --compiler=ldc2, and got these error message:

E:\PuTao\Dlang\hunt-amqp-client\examples\SimpleDemo>dub build --arch=x86_64 --build=debug --compiler=ldc2
Performing "debug" build using ldc2 for x86_64.
hunt 1.6.1: building configuration "library"...
hunt-extra 1.0.0: building configuration "library"...
hunt-net 0.5.0: building configuration "default"...
hunt-time 1.1.0: building configuration "library"...
hunt-proton 1.1.0-beta.2: building configuration "library"...

core.exception.OutOfMemoryError@core\exception.d(647): Memory allocation failed
----------------
0x00007FF73CC9F2B5
0x00007FF73CC9EBE2
0x00007FF73CC9D197
0x00007FF73CC59B1E

It's sure that I have enough free memory ( >8G).

The good news is the demo can be built with DMD. So, can you have a try with DMD?

@Heromyth
Copy link
Contributor

Heromyth commented Jun 16, 2020

By the way, which version is used? I just tested the latest one.

@Ezneh
Copy link
Author

Ezneh commented Jun 16, 2020

By the way, which version is used? I just tested the latest one.

I tested with dmd (latest version), and now I have some linking errors (libcmt.lib and OLDNAMES.lib missing).

And I tested with ldc2 1.21.0 before.

@Heromyth
Copy link
Contributor

If installing dmd without Visual Studio 2017+, you must install the VC 2010+ runtime.

@Ezneh
Copy link
Author

Ezneh commented Jun 17, 2020

If installing dmd without Visual Studio 2017+, you must install the VC 2010+ runtime.

I have Visual Studio 2019 installed and VC 2010 runtime installed too.

@Heromyth
Copy link
Contributor

Heromyth commented Jun 17, 2020

It's so strange. I also failed to build the demo now because of the error: out of memory.
I'll test it again after rebooting my computer later.

Here is my build command:

dub build --arch=x86_64 --build=debug --compiler=dmd

@Heromyth
Copy link
Contributor

Heromyth commented Jun 18, 2020

It fixed now in commit 5a7f52a. I tested with the latest DMD and LDC2 on Windows.

Run dub upgrade to upgrade all the dependencies to the latest.

@Ezneh
Copy link
Author

Ezneh commented Jun 18, 2020

Alright, after dub upgrade, hunt-proton is compiling with LDC2. However, now the issue comes from hunt-amqp (Error: expression AT_MOST_ONCE = ProtonQoS("AT_MOST_ONCE", 0).ordinal() is not a constant)

@Heromyth
Copy link
Contributor

The hunt-amqp should be upgraded to 1.1.0-beta.3 too. Check this in dub.selections.json, please.

@Ezneh
Copy link
Author

Ezneh commented Jun 19, 2020

It is upgraded to that version as well.

Here is my dub.selections.json

{
	"fileVersion": 1,
	"versions": {
		"arsd-official": "8.0.0",
		"hunt": "1.6.1",
		"hunt-amqp": "1.1.0-beta.3",
		"hunt-amqp-client": "1.1.0-beta.2",
		"hunt-cache": "0.8.1",
		"hunt-console": "0.2.0",
		"hunt-database": "2.1.0",
		"hunt-entity": "2.6.0",
		"hunt-extra": "1.0.0",
		"hunt-framework": "3.1.2",
		"hunt-http": "0.6.0",
		"hunt-jwt": "0.1.0-beta.1",
		"hunt-net": "0.5.0",
		"hunt-openssl": "1.0.2",
		"hunt-pool": "1.1.1",
		"hunt-proton": "1.1.0-beta.3",
		"hunt-redis": "1.2.0",
		"hunt-security": "0.4.0",
		"hunt-shiro": "1.1.0",
		"hunt-sql": "1.4.0",
		"hunt-time": "1.1.0",
		"hunt-validation": "0.3.0",
		"libmemcached": "1.1.2",
		"poodinis": "8.1.0-beta.2"
	}
}

@Heromyth
Copy link
Contributor

It's so sorry. A file was fogot to submit. It's fixed now in commit huntlabs/hunt-amqp@a561292

@Ezneh
Copy link
Author

Ezneh commented Jun 26, 2020

Sorry for the late reply, I was busy this week.

I tried compiling again with both dmd and ldc2 and it seems fine (at least, it's compiling). I will make further tests this weekend and see if it is linking and running properly.

Thanks.

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