Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Solved !!!Error Compilation on Mac Os X 10.13.6  (Read 10932 times)

0 Members and 1 Guest are viewing this topic.

lestroso

  • Newbie
  • *
  • Posts: 9
    • View Profile
Solved !!!Error Compilation on Mac Os X 10.13.6
« on: April 03, 2020, 11:44:47 pm »
Dear Friends....
I have Macosx 10.13.6...
i'm trying to compile without success this Beautiful Library...but i've got this message:
Undefined symbols for architecture x86_64:
  "sf::String::String(char const*, std::locale const&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
 

i followed this steps...
compiled with this....: g++ -c main.cpp

then: g++ main.o -o sfml-app -lsfml-graphics -lsfml-window -lsfml-system

but in this point i ecounter this problem....
Undefined symbols for architecture x86_64:
  "sf::String::String(char const*, std::locale const&)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
 

not so far i have upgraded the c++ to c++9 and created a link for c++ to c++9....

I'm sorry for this Casino.....I'm a litttle confused...

But now i have installed right followed this link.:https://www.sfml-dev.org/tutorials/2.5/start-linux.php

I'm sure ...i have installed the library right.....and then i tryed this code:
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}

 

Can somebody help me please?? I'm desperado...Best Regards, Lestroso :'( :'( :'(
« Last Edit: April 05, 2020, 10:28:33 pm by lestroso »

lestroso

  • Newbie
  • *
  • Posts: 9
    • View Profile
Solved! Re: Error Compilation on Mac Os X 10.13.6
« Reply #1 on: April 05, 2020, 09:30:12 pm »
Dear Friend,

i have succeded for the half to Compile SMFL Library!!!!

I have used NetBeans IDE 11.3  with my mac os x 10.13.6 High Sierra..version of gcc is 9...

Now in Debug Mode my app works fine...i have compiled the demo example source for Linux...ok..

I have had to setup also in the linker (inside netbeans) this line of code:"-lsfml-graphics -lsfml-window -lsfml-system".
Also i have putted on c++ the Hedears Library Reference located in the system frameworks....


Ok now if i compile in release mode the compiler say to me:
cd '/Users/saverio/NetBeansProjects/testsmfl'
/usr/bin/make -f Makefile CONF=Release
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
"/Applications/Xcode.app/Contents/Developer/usr/bin/make"  -f nbproject/Makefile-Release.mk dist/Release/GNU-MacOSX/testsmfl
mkdir -p dist/Release/GNU-MacOSX
g++     -o dist/Release/GNU-MacOSX/testsmfl build/Release/GNU-MacOSX/main.o -framework SFML
Undefined symbols for architecture x86_64:
  "sf::CircleShape::CircleShape(float, unsigned long)", referenced from:
      _main in main.o
  "sf::RenderStates::Default", referenced from:
      _main in main.o
  "sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)", referenced from:
      _main in main.o
  "sf::RenderTarget::clear(sf::Color const&)", referenced from:
      _main in main.o
  "sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main.o
  "sf::RenderWindow::~RenderWindow()", referenced from:
      _main in main.o
  "sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)", referenced from:
      _main in main.o
  "sf::Shape::setFillColor(sf::Color const&)", referenced from:
      _main in main.o
  "sf::Shape::setOutlineColor(sf::Color const&)", referenced from:
      _main in main.o
  "sf::Shape::setOutlineThickness(float)", referenced from:
      _main in main.o
  "sf::Shape::~Shape()", referenced from:
      _main in main.o
  "sf::String::String(char const*, std::__1::locale const&)", referenced from:
      _main in main.o
  "sf::Window::close()", referenced from:
      _main in main.o
  "sf::Window::display()", referenced from:
      _main in main.o
  "sf::Window::pollEvent(sf::Event&)", referenced from:
      _main in main.o
  "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
      _main in main.o
  "sf::Window::isOpen() const", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [dist/Release/GNU-MacOSX/testsmfl] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 87ms)


 
Can some bodyhelp me please???Thanks a lot!!! Lestroso :) :) :)
« Last Edit: April 05, 2020, 10:28:49 pm by lestroso »

lestroso

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Solved !!!Error Compilation on Mac Os X 10.13.6
« Reply #2 on: April 05, 2020, 10:28:14 pm »
Dear friends,

i have succeded either in Debug and Release Mode....With Netbeans!!!!Macosx!!!

The trik was to give the right headers either in debug and release mode..and also to put the right strings in the c++ Linker....Now unfortunetly i have problems with the resorce that don't load very well....Ok..Thanks a lot,, lestroso

 

anything