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

Project fails to build properly #505

Open
JamarleyHub opened this issue May 26, 2024 · 1 comment
Open

Project fails to build properly #505

JamarleyHub opened this issue May 26, 2024 · 1 comment

Comments

@JamarleyHub
Copy link

JamarleyHub commented May 26, 2024

I've tried to build the project from 3 different sources and it does not seem to work.
First I had to add

#include <cstdint>

to both
./OpenEXR/src/OpenEXR/OpenEXR/IlmImf/ImfDwaCompressor.cpp
and
./OpenEXR/src/OpenEXR/OpenEXR/IlmImf/ImfMisc.cpp

due to errors:

path/to/build/DJV/DJV-Release/OpenEXR/src/OpenEXR/OpenEXR/IlmImf/ImfDwaCompressor.cpp:1013:38: error: ‘uintptr_t’ does not name a type
 1013 |                 if (reinterpret_cast<uintptr_t>(_rowPtrs[comp][y]) & _SSE_ALIGNMENT_MASK)

and

path/to/build/DJV/DJV-Release/OpenEXR/src/OpenEXR/OpenEXR/IlmImf/ImfDwaCompressor.cpp:745:31: error: ‘uintptr_t’ does not name a type
  745 |         if ((reinterpret_cast<uintptr_t>(rowBlockHandle + i) & _SSE_ALIGNMENT_MASK) == 0)

And after that it spits out an error regarding RapidJSON:

path/to/build/DJV/DJV-install-Release/include/rapidjson/document.h:319:82: error: assignment of read-only member ‘rapidjson::GenericStringRef<CharType>::length’
  319 |     GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }

I presume the build problems are not fixable on your end, since they are third party libraries, right?
I found that the bug regarding the assignment has been fixed so maybe this just needs to be updated on your end?

@JamarleyHub
Copy link
Author

JamarleyHub commented May 26, 2024

So after a bit of fiddling I finally got the project to build:
First obviously you need to include

#include <cstdint> 

in both ImfDwaCompressor.cpp and ImfMisc.cpp

Next you need to remove line 319 in rapidjson/document.h
It looks like this:

GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; }

It's just an assignment operator anyway, no harm in removing it.

For that (if you have followed the steps on the website) you need to open the file

./DJV-Release/DJV-install-Release/include/rapidjson/document.h

After that you still get two more errors to fix, saying that

./DJV-install-Release/include/rapidjson/document.h:885:83: error: macro "RAPIDJSON_ENABLEIF" passed 2 arguments, but takes just 1
  885 |         explicit GenericValue( T b, RAPIDJSON_ENABLEIF( internal::IsSame<bool, T> ) )

and

./DJV-install-Release/include/rapidjson/document.h:892:75: error: macro "RAPIDJSON_STATIC_ASSERT" passed 2 arguments, but takes just 1
  892 |                 RAPIDJSON_STATIC_ASSERT( internal::IsSame<bool, T>::Value );

To fix those errors you need to go into line 885 and 892 of the same documents.h respectively and set a few parentheses like so:

// Old line 885:
// explicit GenericValue( T b, RAPIDJSON_ENABLEIF( internal::IsSame<bool, T> ) )
// Fixed line:
explicit GenericValue( T b, RAPIDJSON_ENABLEIF( (internal::IsSame<bool, T>) ) )

// ...

// Old line 892:
// RAPIDJSON_STATIC_ASSERT( internal::IsSame<bool, T>::Value );
// Fixed line:
RAPIDJSON_STATIC_ASSERT( (internal::IsSame<bool, T>::Value) );

Save and exit the file.
The project should now compile and run properly.

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

1 participant