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

how to fix RapidJSON error? #6

Open
luckypoem opened this issue Apr 20, 2018 · 5 comments
Open

how to fix RapidJSON error? #6

luckypoem opened this issue Apr 20, 2018 · 5 comments

Comments

@luckypoem
Copy link

after running "cmake -DCMAKE_BUILD_TYPE=Release ." ,i encountered the error:

...
CMake Error at CMakeLists.txt:21 (find_package):
By not providing "FindRapidJSON.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"RapidJSON", but CMake did not find one.

Could not find a package configuration file provided by "RapidJSON" with
any of the following names:

RapidJSONConfig.cmake
rapidjson-config.cmake

Add the installation prefix of "RapidJSON" to CMAKE_PREFIX_PATH or set
"RapidJSON_DIR" to a directory containing one of the above files. If
"RapidJSON" provides a separate development package or SDK, be sure it has
been installed.

-- Configuring incomplete, errors occurred!
See also "/home/ec2-user/c3blog/CMakeFiles/CMakeOutput.log".
See also "/home/ec2-user/c3blog/CMakeFiles/CMakeError.log".
[ec2-user@ip-172-31-43-208 c3blog]$

how to fix RapidJSON error?

@evandrix
Copy link

evandrix commented Jan 4, 2019

bump

@CircuitCoder
Copy link
Owner

Sorry for the (extremely) delayed reply. Since I didn't have time to work on this project lately, and I really didn't expect anyone to use it besides myself, I haven't been paying much attention.

It seems in the latest APT repository of Ubuntu, FindRapidJSON.cmake is not distributed with package rapidjson-dev. I'm not sure about other linux distributions, but it seems ArchLinux has it in the package rapidjson.

I'll try to include a copy of the cmake module along the source code. Then it should compile successfully.

@CircuitCoder
Copy link
Owner

OK so rapidjson is a header only library, and all appearances of the library headers in the source code is properly prefixed, so I guess we can just skip the find_package?

But doing so will cause a template deduction error. I'm not sure if the packaged provided by ubuntu is broken or not, but compiling the library from source works for me (on WSL).

# sudo apt install pkgconf
git clone https://github.com/Tencent/rapidjson.git
cd rapidjson
cmake .
make
sudo make install

Then cmake within this project should complete without error.

I'll leave this issue open until I can find a proper solution (or give up).

@FlySkyPie
Copy link

# sudo apt install pkgconf
git clone https://github.com/Tencent/rapidjson.git
cd rapidjson
cmake .
make
sudo make install

I did the install, issue still exist, so I added Findrapidjson.cmake to cmake/Modules.

@gioipv
Copy link

gioipv commented Sep 10, 2021

OK so rapidjson is a header only library, and all appearances of the library headers in the source code is properly prefixed, so I guess we can just skip the find_package?

But doing so will cause a template deduction error. I'm not sure if the packaged provided by ubuntu is broken or not, but compiling the library from source works for me (on WSL).

# sudo apt install pkgconf
git clone https://github.com/Tencent/rapidjson.git
cd rapidjson
cmake .
make
sudo make install

Then cmake within this project should complete without error.

I'll leave this issue open until I can find a proper solution (or give up).

it worked for me. Thankyou. I install rapidjson with root permission

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

5 participants