How would I install gmp (big num) so CLion sees it?

Hi,

Can I follow windows tutorials that I find online to install gmp(big num) and CLion will pickup on my default system parts? Do I have do something specific for CLion to see gmp(big num) after it is installed?

Best

2 comments
Comment actions Permalink

Hi Brian.

Please try to use find_package CMake command to locate the libary:

find_package(GMP REQUIRED)


Also use include_directories to include the libary header files.

include_directories(${GOBJECT_INCLUDE_DIR})
add_executable(ExecutableName Main.cpp)
target_link_libraries(ExecutableName ${GOBJECT_LIBRARIES})


You can find out some additional information here: http://stackoverflow.com/questions/6975718/cmake-basic-library-linking-problem
Does that help?

0
Comment actions Permalink

If you are on Windows and using Cygwin as your tool chain, start Cygwin Setup and grab to the bin and src for...

  • gmp: Library for arbitrary precision arithmetic
  • gmp-debuginfo: Debug into for gmp
  • libgmp-devel: Library for arbitrary precision arithmetic (development)
  • libgmp-doc: Library for arbitrary precision arithmetic (documentation)
  • libgmpxx4: Library for arbitrary precision arithmetic (C++ runtime

 

Let that download and install.

Now, in your CmakeLists.txt file add the line

set(CMAKE_C_FLAGS "-lgmp")

 

Now you'll be able to include and compile with #include <gmp.h>.

 

I hope this helps.

0

Please sign in to leave a comment.