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

Author Topic: Linking error when linking QT IOS app  (Read 1220 times)

0 Members and 1 Guest are viewing this topic.

Haize

  • Newbie
  • *
  • Posts: 15
    • View Profile
Linking error when linking QT IOS app
« on: May 07, 2017, 05:53:53 pm »
Hi everybody,

I am having problems linking a QT IOS app when using the SFML libs.

The error I am getting is

ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
Undefined symbols for architecture x86_64:
  "sf::Shape::~Shape()", referenced from:
      sf::CircleShape::~CircleShape() in main.o
  "sf::CircleShape::CircleShape(float, unsigned long)", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64


So it seems the libraries I have built are not for the architecture I am building for (iPhone SE simulator - x86_64). But I have followed the instructions to build for x86_64. See below.

The main.cpp that references SFML looks like this:
#include <QGuiApplication>
#include <QQmlApplicationEngine>

#include <SFML/Graphics/CircleShape.hpp>

int main(int argc, char *argv[])
{
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        QGuiApplication app(argc, argv);

        QQmlApplicationEngine engine;
        engine.load(QUrl(QLatin1String("qrc:/main.qml")));

        sf::CircleShape circleshape;

        return app.exec();
}

My .pro file includes the sfml-graphics lib:
macx: LIBS += -L$$PWD/build/lib/ -lsfml-graphics-s-d

INCLUDEPATH += $$PWD/../../Libraries/SFML/include
DEPENDPATH += $$PWD/../../Libraries/SFML/include

macx: PRE_TARGETDEPS += $$PWD/build/lib/libsfml-graphics-s-d.a

To build the SFML libraries I am using I done the following:
  • Downloaded the SFML repo from git hub
  • Set variable "IOS" to true in CMake before configuring and generating a xcode proj. See attached image
  • Opened the generated xcode project and set target to "iPhone SE" (simulator)
  • Built SFML libraries

This resulted in the static libraries I was expecting but when linking with these libraries in QT creator and building for a iPhone SE simulator I get the linking error above. When opening the Xcode proj generator by QT creator I also get the same linking error.

I have followed the instructions from the post https://en.sfml-dev.org/forums/index.php?topic=13716.0

Has anyone been able to get SFML working for IOS? And better still QT and IOS? I am having a hard time finding any resources on this subject. So is IOS still in experimental stage with SFML?

Thanks for any help you can give.
« Last Edit: May 07, 2017, 07:23:30 pm by Haize »

 

anything