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

"Virtual functions are pure" build error with RLock (HXCPP) #21

Closed
EliteMasterEric opened this issue Aug 11, 2022 · 4 comments
Closed
Labels

Comments

@EliteMasterEric
Copy link

The following error occurs during compilation of any project which includes hx.concurrent.lock.RLock, even a minimal one.,

Error: ./src/hx/concurrent/lock/RLock.cpp: In static member function ‘static Dynamic hx::concurrent::lock::RLock_obj::__CreateEmpty()’:
./src/hx/concurrent/lock/RLock.cpp:47:49: error: invalid new-expression of abstract class type ‘hx::concurrent::lock::RLock_obj’
   47 | Dynamic RLock_obj::__CreateEmpty() { return new RLock_obj; }
      |                                                 ^~~~~~~~~
In file included from ./src/hx/concurrent/lock/RLock.cpp:13:
include/hx/concurrent/lock/RLock.h:21:30: note:   because the following virtual functions are pure within ‘hx::concurrent::lock::RLock_obj’:
   21 | class HXCPP_CLASS_ATTRIBUTES RLock_obj : public  ::hx::concurrent::lock::AbstractAcquirable_obj
      |                              ^~~~~~~~~
In file included from ./src/hx/concurrent/lock/RLock.cpp:7:
include/hx/concurrent/lock/AbstractAcquirable.h:48:30: note:     ‘virtual bool hx::concurrent::lock::AbstractAcquirable_obj::tryAcquire(int)’
   48 |                 virtual bool tryAcquire(int timeoutMS) = 0;
      |                              ^~~~~~~~~~
./src/hx/concurrent/lock/RLock.cpp: In static member function ‘static Dynamic hx::concurrent::lock::RLock_obj::__Create(hx::DynamicArray)’:
./src/hx/concurrent/lock/RLock.cpp:53:65: error: invalid new-expression of abstract class type ‘hx::concurrent::lock::RLock_obj’
   53 |         ::hx::ObjectPtr< RLock_obj > _hx_result = new RLock_obj();
      |                                                                 ^
./src/hx/concurrent/lock/RLock.cpp: In static member function ‘static hx::ObjectPtr<hx::concurrent::lock::RLock_obj> hx::concurrent::lock::RLock_obj::__new()’:
./src/hx/concurrent/lock/RLock.cpp:211:61: error: invalid new-expression of abstract class type ‘hx::concurrent::lock::RLock_obj’
  211 |         ::hx::ObjectPtr< RLock_obj > __this = new RLock_obj();
      |                                                             ^
./src/hx/concurrent/lock/RLock.cpp: In static member function ‘static void hx::concurrent::lock::RLock_obj::__register()’:
./src/hx/concurrent/lock/RLock.cpp:356:19: error: cannot declare variable ‘_hx_dummy’ to be of abstract type ‘hx::concurrent::lock::RLock_obj’
  356 |         RLock_obj _hx_dummy;
      |                   ^~~~~~~~~

Building with HXCPP on the Linux platform.

@sebthom
Copy link
Member

sebthom commented Aug 11, 2022

You can check the tests and the github action which successful builds on Linux targeting HXCPP

@sebthom sebthom closed this as completed Aug 11, 2022
@sebthom
Copy link
Member

sebthom commented Aug 11, 2022

Sorry didn't plan to close the issue. Fat fingers

@sebthom sebthom reopened this Aug 11, 2022
@stale
Copy link

stale bot commented Oct 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@EliteMasterEric
Copy link
Author

Apologies for the delayed response. After running the test provided by the Github Action (and finding it successfully builds and runs), I did some more investigation. I found that the issue occurs when building the project using the Lime framework's build tool, and was able to recreate the problem in a minimal sample project.

You can find my full writeup at #22.

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

No branches or pull requests

2 participants