Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Trying to compile using C++11


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Atemu   Members   -  Reputation: 232

Like
0Likes
Like

Posted 11 January 2014 - 10:17 AM

Hey,

 

I'm working on a small OpenGL project and I would like to use C++11 however when I'm trying to compile I get errors :/ Those errors aren't happening when I'm using C++98.

g++ -std=c++11 -Wall -I/opt/local/include -Iinclude src/main.cpp -o src/main.o
Undefined symbols for architecture x86_64:
  "RenderWindow::init(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, int)", referenced from:
      _main in ccLk05Ex.o
  "RenderWindow::show()", referenced from:
      _main in ccLk05Ex.o
  "RenderWindow::shutdown()", referenced from:
      _main in ccLk05Ex.o
  "RenderWindow::instance_", referenced from:
      RenderWindow::getInstance()       in ccLk05Ex.o
  "RenderWindow::RenderWindow()", referenced from:
      RenderWindow::getInstance()       in ccLk05Ex.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [src/main.o] Error 1

The content of my main.cpp:

#include <iostream>

#include "renderwindow.h"

int main() {
    RenderWindow *renderWindow = RenderWindow::getInstance();
    renderWindow->init("OpenGL Framework", 640, 480);

    renderWindow->show();

    renderWindow->shutdown();
}

My OS is Mac OS X 10.9 and I'm using GLEW, GLFW and GLM.

 

Would you have any idea why I got those errors ?

 

Thanks in advance !

 



Sponsor:

#2 jjd   Crossbones+   -  Reputation: 2122

Like
4Likes
Like

Posted 11 January 2014 - 10:41 AM

I think you'll need to show us the header and the source for RenderWindow. However, I think your invocation of g++ maybe wrong. It looks like you are trying to compile main but you are asking it to build a binary. Perhaps you meant to use -c instead of -o?

 

-Josh


--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet


#3 Atemu   Members   -  Reputation: 232

Like
0Likes
Like

Posted 11 January 2014 - 10:45 AM

I think you'll need to show us the header and the source for RenderWindow. However, I think your invocation of g++ maybe wrong. It looks like you are trying to compile main but you are asking it to build a binary. Perhaps you meant to use -c instead of -o?

 

-Josh

Thank you so much !!! I removed the -c option accidentally :) It's now compiling !






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS