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 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 ASP.NET C# based MMOG (Massively multiplayer online game). I would
If you want to develop against WordPress (i.e., have a local instance running on
I want to develop simple Serverless LAN Chat program just for fun. How can
I want to develop a windows application. If I use native C++ and MFC
I want to develop Java apps, real quick, what IDE should I choose?
I want to develop a mobile web application using asp.net 3.5 that can be
I want to develop a very simple 2D game in Python. Pygame is the
I want to develop an iPhone application using the utility template, where the flip
Imagine that you want to develop a non-trivial end-user desktop (not web) application in
I want our team to develop against local instances of an Oracle database. With

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.