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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:48:38+00:00 2026-05-17T15:48:38+00:00

I want to develop C++ programs on mac os and I have installed Xcode

  • 0

I want to develop C++ programs on mac os and I have installed Xcode with a bunch of frameworks.

However I would like to write code without Xcode IDE but just write my own makefile and directly compile/link with gcc (shipped with Xcode).

Take a opengl program as example. I tried to compile it with the command:

gcc -I/usr/include/
-I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/GLUT.framework/Headers/
-I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework/Headers
-L/usr/lib -L/usr/X11/lib/ -L/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/OpenGL.framework/Libraries/
-lGL -lGLU -lGLUTt main.cpp

or

gcc -I/usr/include/ -L/usr/lib
-framework OpenGL -framework GLUT -lm main.cpp

But they ended up with linking error

Undefined symbols:
“std::basic_ostream

::operator<<(long)”, referenced from:
reshape(int, int)in ccKBRSF9.o
display() in ccKBRSF9.o “___gxx_personality_v0”, referenced
from:
___gxx_personality_v0$non_lazy_ptr in ccKBRSF9.o
(maybe you meant: ___gxx_personality_v0$non_lazy_ptr) “std::ios_base::Init::~Init()”,
referenced from:
___tcf_0 in ccKBRSF9.o “std::basic_string,
std::allocator
::operator[](unsigned long) const”, referenced from:
std::__verify_grouping(char const*, unsigned long,
std::basic_string,
std::allocator > const&)in
ccKBRSF9.o
std::__verify_grouping(char const*, unsigned long,
std::basic_string,
std::allocator > const&)in
ccKBRSF9.o
std::__verify_grouping(char const*, unsigned long,
std::basic_string,
std::allocator > const&)in
ccKBRSF9.o “std::basic_ostream >&
std::operator<<

(std::basic_ostream >&, char
const*)”, referenced from:
keyboard(unsigned char, int, int)in ccKBRSF9.o
keyboard(unsigned char, int, int)in ccKBRSF9.o
keyboard(unsigned char, int, int)in ccKBRSF9.o
reshape(int, int)in ccKBRSF9.o
display() in ccKBRSF9.o “std::ios_base::Init::Init()”,
referenced from:
__static_initialization_and_destruction_0(int, int)in ccKBRSF9.o
“std::basic_string,
std::allocator >::size() const”,
referenced from:
std::__verify_grouping(char const*, unsigned long,
std::basic_string,
std::allocator > const&)in
ccKBRSF9.o “std::cout”, referenced
from:
__ZSt4cout$non_lazy_ptr in ccKBRSF9.o
(maybe you meant: __ZSt4cout$non_lazy_ptr) ld: symbol(s) not found collect2: ld returned 1 exit
status

Did I miss something?

  • 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-17T15:48:39+00:00Added an answer on May 17, 2026 at 3:48 pm

    Use g++ to compile C++. It’s the C++ front-end for GCC. E.g.:

    g++ -I/usr/include/ -L/usr/lib -framework OpenGL -framework GLUT -lm main.cpp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop cross platform mobile app. I have seen frameworks listed below
I want to develop an app to display the programs schedule of a specific
I want develop some web product with using javascript 3d library like three.js But
Want to develop a query refinement tool just like Google Suggest so that i
I want to develop app which will recognize object(like monument or something) present in
I want to develop an Android app in which I have key log press.
I want to get a feel of Iphone and develop applications like HelloWorld just
I want to develop windows C/C++ program, but i need in it functionality like
I want to work with Asterisk and develop some Programs for working with that.
I develop a project using .jar to reuse code. So I have on .jar

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.