How to create a libphonenumber google C ++ library for Win32

Some of our team's developers use versions of Java and C # libphonenumber , a normalization library for international phone numbers.

They claim it is wonderful / magical / etc.

Unfortunately, being a Win32 C ++ developer, my simple mind cannot fully understand all the miracles and magic of CMake, boost, and many other libraries, and I cannot create a library at all.

Can someone provide some hints or urls to help me point in the right direction so that we can build this project and use it?

The current stumbling block when I try to start CMake (following the instructions in a very short readme), I get the following error message:

> -- Could NOT find Boost
> -- Configuring incomplete, errors occurred!

It seemed to me that I set BOOST_ROOT correctly, but apparently I was either mistaken or skipped other env vars.

How can I create this library?

We are using VS 2008, but I also have VS 2010 on my machine. I would be happy to get an assembly with one of them.

+5
source share
4 answers

Your CMake may be deprecated from the Boost version you installed. Check the FindBoost.cmake file located in the CMake Modules directory. It should contain the following section:

set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
    "1.46.1" "1.47" "1.47.0"
    "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
    "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
    "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
    "1.34" "1.33.1" "1.33.0" "1.33")
0
source

You can try passing BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to the compiler; this way you can completely bypass the cmake module search.

0
source
  • Boost_ADDITIONAL_VERSIONS FindBoost.cmake, , .
  • CMakeLists.txt \libphonenumber\cpp, find_package (Boost 1.40.0 COMPONENTS thread)

 set(Boost_USE_STATIC_LIBS        ON)
 set(Boost_USE_MULTITHREADED      ON)
 set(Boost_USE_STATIC_RUNTIME    OFF) //since CMake 2.8.3
 find_package (Boost 1.47.0 COMPONENTS thread)

3. Run mkdir buildin \ libphonenumber \ cpp, cd build 4. Run cmake -G "your generator" -DBOOST_ROOT = "you_path_to_boost_147_0 folder", for example:cmake -G "Visual Studio 10" ../ -DBOOST_ROOT="E:\libphonenumber\cpp\3rdparty"

0
source

Try compiling it with cygwin , it looks like a standard UNIX build environment, but it works on Windows. It is usually easier to compile open source libraries using Visual Studio.

0
source

All Articles