-
Notifications
You must be signed in to change notification settings - Fork 15
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
Any process to build this. #1
Comments
Hi pulkitnandan, I suppose you are using CMake with Linux or MacOS This is what I recommend: 1- First build a Microsoft C++ REST SDK (Casablanca) project: Install all the needed build tools and libraries: sudo apt-get install g++ git make libboost-all-dev libssl-dev cmake clone casablanca repository: git clone https://github.com/Microsoft/cpprestsdk.git casablanca build the project: cd casablanca/Release cmake . make Now test that for example BlackJack example works executing: casablanca/Release/Binaries/blackjackserver and typing in your browser the URL: If you can see a json, great! it works fine and you can continue, if something went wrong you have to make this step work before continuing. you may have more information about this first step here: https://github.com/Microsoft/cpprestsdk/wiki 2 - Integrating granada to C++ REST SDK: so you now should have: In each of these folders you should have other folders and files. And in samples/granada a CMakeLists.txt file. I recommend your casablanca/Release/samples/granada/CMakeLists.txt look like this for the moment: set(GRANADA_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src/granada") add_subdirectory(sessions-get-and-post) #add_subdirectory(sessions-login-and-cart) #add_subdirectory(oauth2-server) #add_subdirectory(plugin-server) (I have commented 3 of the 4 examples, so you first build the project with only one and easy example that does not require ANY extra libraries to work) After that, include this line in the bottom of the casablanca/Release/CMakeLists.txt: add_subdirectory(samples/granada) These CMakeLIsts file should look to something like this: https://github.com/webappsdk/granada/blob/master/Release/CMakeLists.txt Now build the project again: cd casablanca/Release cmake . make if everything is OK now you should have your executable created: execute it and type http://localhost:80/ in your browser, you should see something like: LOG: That's it. Please tell if this was helpful or not and don't hesitate to contact if you have more problems providing more information like console logs, operative system you are using, if you successfully built a C++ REST SDK project ... |
I'm using windows as development platform. Boost libraries seems to be the main issue here apart from pthreads.h. Tried BOOST_ROOT but then it complains of not founding some libs Boost version: 1.55.0 Boost include path: C:/local/boost_1_55_0 Could not find the following Boost libraries:
|
To build all targets on linux, it got stuck at |
Hi and thanks for sharing, So I suppose, you can build all the examples except the plug-in examples? I think your problem here is related to Mozilla Spidermonkey lib. For the moment I have only tested granada with Spider Monkey version 38, so using newer versions and older versions will NOT work (99% sure) as the Spidermonkey lib evolves a lot in each release. So use version 38. What I would recommend is you build the Mozilla Spidermonkey. See this link to check how to do it: Spidermonkey build documentation In the CMakeList.txt of the example (Release/samples/granada/plugin-server/CMakeLists.txt) substitute the include_directories and link_directories paths by the real paths to your mozjs include and lib. in my case it looks like this: include_directories(/opt/mozjs-38.0.0/js/src/build_OPT.OBJ/dist/include) link_directories(/opt/mozjs-38.0.0/js/src/build_OPT.OBJ/dist/lib) (sorry, I have to document this better). Build again the project and execute the generated executable, use a browser and type the URL: http://localhost to use the client application, if everything is OK you should see the math plug-ins in action. If you are using Windows to build your project I recommend using Visual Studio. In the C++ REST SDK documentation Microsoft recommends not to try to build C++ REST SDK with CMake on Windows, they recommend to use Visual Studio 2013 (https://github.com/Microsoft/cpprestsdk/wiki/How-to-build-for-Windows). Once you have the cpprestsdk built and functional on Windows you can build granada in Visual Studio as a static lib or dll (excluding the examples in the samples directory) building it first without the classes that use Redis and Mozilla Spidermonkey. Once you have granada built as a lib, build each example as a separate project that use the granada generated lib. Run the resulting .exe as administrator. |
Granada has been tested on Windows too using Visual Studio 2013 to build it. I have edited the previous comment adding this information. |
I have failing to let cmake find boost libraries and pthread libs and headers, is this project working, does it's setup require more information. As after following standard process to setup this project, I'm failing and have lost atleat 20 hours.
The text was updated successfully, but these errors were encountered: