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

  • SEARCH
  • Home
  • 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 3407142
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:42:52+00:00 2026-05-18T05:42:52+00:00

The problem: At the moment im compiling on Ubuntu but my server is running

  • 0

The problem: At the moment im compiling on Ubuntu but my server is running Fedora/Redhat. Ubunutu uses boost 1.42 and linux latest at this very moment is 1.41. So what i decided was to download the boost lib and put it in the folder of my workspace

Here is the directory structure

/workspace
    /myprogram
        /src
            /main.cpp
        /Debug
            /main
    /boost_1_42_0
        /downloaded from boost.com

In my main.cpp, i have this code

#include "../../boost_1_42_0/boost/regex.hpp"

Is this even posible or am i barking up the wrong tree. I have tried to compile it but it failed (ofcourse) with 13 errors

If i missed some information please ask for it, il try providing it

Make File (My Program is called vlogd)

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include src/subdir.mk
-include src/class/vException/subdir.mk
-include src/class/mysqlcppapi/subdir.mk
-include src/class/mysqlcppapi/row/subdir.mk
-include src/class/mysqlcppapi/query_results/subdir.mk
-include src/class/mysqlcppapi/query/subdir.mk
-include src/class/mysqlcppapi/fields/subdir.mk
-include src/class/mysqlcppapi/exceptions/subdir.mk
-include src/class/mysqlcppapi/datetime/subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 

# All Target
all: vlogd

# Tool invocations
vlogd: $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: GCC C++ Linker'
    g++ -L/usr/lib64/mysql -L../../boost_1_42_0/lib/ -o"vlogd" $(OBJS) $(USER_OBJS) $(LIBS)
    @echo 'Finished building target: $@'
    @echo ' '

#     Other Targets
clean:
    -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) vlogd
    -@echo ' '

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

Object File

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

USER_OBJS :=

LIBS := -lmysqlclient -lboost_regex
  • 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-05-18T05:42:52+00:00Added an answer on May 18, 2026 at 5:42 am

    No need to include using full path, if you use gcc just specify the correct include path and link path

    gcc -I../../boost_1_42_0/ myprogram.cpp -L../../boost_1_42_0/lib -lboostXYZ
    

    Thus, all #include <boost/...> headers and libs will be first searched in your local boost.

    Edit
    Following the question in the comment.

    By default -l will search for .so libraries. So if boost is built with e.g. libboost_regex.so and liboost_regex.a, then by default you will link to the .so. If you’re linked to .so, on the working server you need to have correct versions of these libraries (several boost versions can be installed).

    If you want to link implicitly to the static versions, either use the full path

    gcc .... ../../boost_1_42_0/lib/libboost_regex.a
    

    or

    gcc ... -Wl,-Bstatic -L../../boost_1_42_0/lib -lboost_regex -Wl,-Bdynamic
    

    or (in newer versions of ld)

    gcc ... -L../../boost_1_42_0/lib -l:libboost_regex.a
    

    Having the binary with ldd command you may see its shared library dependencies and check if boost ones are among them

    ldd ./yourapp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem with PHP at the moment, I am getting this
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem solved: Thanks guys, see my answer below. I have a website running in
On Linux (kernel 2.6.5) our build system calls gcc with -D_REENTRANT . Is this
I have an incredibly frustrating problem cleaning up my site at the moment. On
Problem: I have an address field from an Access database which has been converted
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
Problem: Ajax suggest-search on [ n ] ingredients in recipes. That is: match recipes
Problem: Given a list of strings, find the substring which, if subtracted from the
Problem is described and demonstrated on the following links: Paul Stovell WPF: Blurry Text

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.