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 8515385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:07:57+00:00 2026-06-11T05:07:57+00:00

I’m having trouble linking a very simple c++ program on OSX Lion. The error

  • 0

I’m having trouble linking a very simple c++ program on OSX Lion. The error message is

Undefined symbols for architecture x86_64: "std::basic_string<char, std::char_traits<char>

Here’s the complete verbose output from the compiler:

Nicholass-MacBook-Pro:hello_vbo-build jubei$ make VERBOSE=1
"/Applications/CMake 2.8-9.app/Contents/bin/cmake" -H/Users/jubei/coding/hello_vbo -               B/Users/jubei/coding/hello_vbo-build --check-build-system CMakeFiles/Makefile.cmake 0
"/Applications/CMake 2.8-9.app/Contents/bin/cmake" -E cmake_progress_start /Users/jubei/coding/hello_vbo-build/CMakeFiles /Users/jubei/coding/hello_vbo-build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make -f CMakeFiles/hellovbo.dir/build.make CMakeFiles/hellovbo.dir/depend
cd /Users/jubei/coding/hello_vbo-build && "/Applications/CMake 2.8-9.app/Contents/bin/cmake" -E cmake_depends "Unix Makefiles" /Users/jubei/coding/hello_vbo /Users/jubei/coding/hello_vbo /Users/jubei/coding/hello_vbo-build /Users/jubei/coding/hello_vbo-build /Users/jubei/coding/hello_vbo-build/CMakeFiles/hellovbo.dir/DependInfo.cmake --color=
make -f CMakeFiles/hellovbo.dir/build.make CMakeFiles/hellovbo.dir/build
"/Applications/CMake 2.8-9.app/Contents/bin/cmake" -E cmake_progress_report/Users/jubei/coding/hello_vbo-build/CMakeFiles 1
[100%] Building CXX object CMakeFiles/hellovbo.dir/main.cpp.o
/opt/local/bin/g++-mp-4.8    --std=c++11 -I/usr/local/include -I/Users/jubei/coding/hello_vbo/include    -o CMakeFiles/hellovbo.dir/main.cpp.o -c /Users/jubei/coding/hello_vbo/main.cpp
Linking CXX executable hellovbo
"/Applications/CMake 2.8-9.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/hellovbo.dir/link.txt --verbose=1
/opt/local/bin/g++-mp-4.8   --std=c++11 -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/hellovbo.dir/main.cpp.o  -o hellovbo  -L/usr/local/lib -lglfw -lglew -framework Cocoa -framework OpenGL -framework IOKit -lstdc++ 
Undefined symbols for architecture x86_64:
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)", referenced from:
  readTextFile(char const*) in main.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [hellovbo] Error 1
make[1]: *** [CMakeFiles/hellovbo.dir/all] Error 2
make: *** [all] Error 2

I’ve seen various posts saying that this kind of error is due to people using gcc instead of g++ but in my case I use g++. I’m compiling using a macports built GCC 4.8.

Note that this simple program would compile fine on the same system. After a clean install all of a sudden it refuses to compile.

  • 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-11T05:07:58+00:00Added an answer on June 11, 2026 at 5:07 am

    The missing symbol is the move assignment operator for std::string. I’m going to guess here that what’s going on is you’re mixing object files/libraries that are compiled with libstd++ and libc++.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.