I am using the Boost library and I am having some linker issues. Currently my code is outputting this:

> 
> Undefined symbols for architecture x86\_64:
> "boost::program\_options::to\_internal(std::\_\_1::basic\_string<char, std::\_\_1::char\_traits, std::\_\_1::allocator > const&)", referenced from:
> std::\_\_1::vector<std::\_\_1::basic\_string<char, std::\_\_1::char\_traits, std::\_\_1::allocator >, std::\_\_1::allocator<std::\_\_1::basic\_string<char, std::\_\_1::char\_traits, std::\_\_1::allocator > > > boost::program\_options::to\_internal<std::\_\_1::basic\_string<char, std::\_\_1::char\_traits, std::\_\_1::allocator > >(std::\_\_1::vector<std::\_\_1::basic\_string<char, std::\_\_1::char\_traits, std::\_\_1::allocator >, std::\_\_1::allocator<std::\_\_1::basic\_string<char, std::\_\_1::char\_traits, std::\_\_1::allocator > > > const&) in train\_model\_main.cc.o
> "boost::program\_options::variables\_map::variables\_map()", referenced from:
> \_main in train\_model\_main.cc.o (THE LIST CONTINUES)
> 
> 
> 

At the bottom my code says this:

> 
> ld: symbol(s) not found for architecture x86\_64
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> 
> 
> 

I am trying to use the program\_options library from Boost, but the linking step seems to be failing. Here is how I link in my CMake file:

```
find_package(Boost 1.73.0 COMPONENTS program_options REQUIRED)
if(Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})
    add_executable(main ./apps/something.cc)
    target_link_libraries( main program_options)
endif()

```

I believe that I am correctly linking the library, so what could be causing this issue?