Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8324429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:04:22+00:00 2026-06-09T00:04:22+00:00

I’m trying to understand what’s wrong with my cmake setup. I downloaded the code

  • 0

I’m trying to understand what’s wrong with my cmake setup. I downloaded the code described in http://alexott.net/en/cpp/BoostAsioProxy.html. It’s an asyncrhonous http proxy server using boost.

These are the contents of my CMakeLists.txt:

cmake_minimum_required(VERSION 2.4)
PROJECT(asio-proxy-async)

# Usage: 
#   cmake . -DCMAKE_INCLUDE_PATH=~/exp/include -DCMAKE_LIBRARY_PATH=~/exp/lib
#

SET(CMAKE_VERBOSE_MAKEFILE ON)

SET (CMAKE_MODULE_PATH ${cpptests_SOURCE_DIR}/cmake CACHE PATH "local cmake")

ADD_DEFINITIONS(-g -Wall -ansi -Wno-deprecated)

SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREAD ON)
FIND_PACKAGE(Boost 1.49.0 REQUIRED COMPONENTS filesystem system thread regex)
MESSAGE(STATUS "** Boost Include: ${Boost_INCLUDE_DIR}")
MESSAGE(STATUS "** Boost Libraries: ${Boost_LIBRARIES}")
IF(Boost_FOUND)
  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
        LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ENDIF(Boost_FOUND)

SET(USED_LIBS ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_REGEX_LIBRARY})

ADD_EXECUTABLE(asio-proxy-async proxy.cpp proxy-server.cpp proxy-conn.cpp)
TARGET_LINK_LIBRARIES(asio-proxy-async ${USED_LIBS})

After I type cmake . the 3 source files compile just ok, but then in the linking phase, I get this:

Linking CXX executable asio-proxy-async
/usr/bin/cmake -E cmake_link_script CMakeFiles/asio-proxy-async.dir/link.txt --verbose=1
/usr/bin/c++      CMakeFiles/asio-proxy-async.dir/proxy.o CMakeFiles/asio-proxy-async.dir/proxy-server.o CMakeFiles/asio-proxy-async.dir/proxy-conn.o  -o asio-proxy-async -rdynamic -lboost_system-mt -lboost_thread-mt -lboost_regex-mt 
CMakeFiles/asio-proxy-async.dir/proxy.o: In function `__static_initialization_and_destruction_0':
/usr/local/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
CMakeFiles/asio-proxy-async.dir/proxy.o: In function `error_code':
/usr/local/include/boost/system/error_code.hpp:315: undefined reference to `boost::system::system_category()'
CMakeFiles/asio-proxy-async.dir/proxy.o: In function `boost::asio::error::get_system_category()':
/usr/local/include/boost/asio/error.hpp:216: undefined reference to `boost::system::system_category()'
CMakeFiles/asio-proxy-async.dir/proxy.o: In function `thread_exception':
/usr/local/include/boost/thread/exceptions.hpp:49: undefined reference to `boost::system::system_category()'
CMakeFiles/asio-proxy-async.dir/proxy.o: In function `condition_error':
/usr/local/include/boost/thread/exceptions.hpp:82: undefined reference to `boost::system::system_category()'
CMakeFiles/asio-proxy-async.dir/proxy-server.o: In function `__static_initialization_and_destruction_0':
/usr/local/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
CMakeFiles/asio-proxy-async.dir/proxy-conn.o: In function `__static_initialization_and_destruction_0':
/usr/local/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/local/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make[2]: *** [asio-proxy-async] Error 1
make[2]: Leaving directory `/home/nelsonrp/workspace/boost-test/asio-proxy-async'
make[1]: *** [CMakeFiles/asio-proxy-async.dir/all] Error 2
make[1]: Leaving directory `/home/nelsonrp/workspace/boost-test/asio-proxy-async'
make: *** [all] Error 2

I’ve seen a couple of posts here in SO talking about this kind of problems with cmake and boost, none of them with final answers though. To clarify things a bit more, let me just point out that if I do:

g++ -g -Wall -c proxy.cpp
g++ -g -Wall -c proxy-conn.cpp
g++ -g -Wall -c proxy-server.cpp
g++ proxy.o proxy-server.o proxy-conn.o -o asio-proxy-async -lboost_system -lboost_thread -lboost_regex -lboost_filesystem

The source compiles just fine, which means that I have boost installed and it is in the right place, the problem just seems to be with cmake. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:04:23+00:00Added an answer on June 9, 2026 at 12:04 am

    The source code archive available on the page ships with its own outdated version of the FindBoost.cmake module. Remove the outdated module file, whose path is asio-proxy-async/cmake/FindBoost.cmake, then re-create your build folder and run cmake again. This will make CMake use the standard FindBoost module which should have no problems finding your existing Boost installation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.