Dec 1, 2014 at 4:46 AM
Edited Dec 1, 2014 at 9:47 PM
I have successfully built a 32-bit version of C++ Rest SDK v2.3 on RHEL 7 64-bit. It was easier than expected as I was able to use pre-built packages. Here's what I did.
Step 1: Install 32-bit boost and openssl. I used the pre-built packages in the RHEL 7 repository. If you need a newer version of boost or openssl, you'll have to build from source. @damienhocking above post may be correct or a good starting point for source
sudo yum install boost-devel.i686
sudo yum install openssl-devel.i686
sudo yum update
Step 2: Build a 32-bit version of C++ Rest SDK. The method is quite similar to building the default size.
CXX="g++ -m32" cmake .. -DCMAKE_BUILD_TYPE=Release
Step 3: Test the build. All tests should pass.
Step 4: Build your program. When you build or execute your program, be very careful to specify the correct LD_LIBRARY_PATH. You may need to specify both 32 and 64 bit directories. Be sure to specify either -m32 or -m64 on the g++ commands to force compilation
using the desired bittedness. For example:
g++ t.cpp -m32 -O2 -pthread -march=native -std=c++11 -I /home/casablanca/Release/include -L /home/casablanca/Release/build.release32/Binaries -lcpprest