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

Author Topic: IOS Linker issue  (Read 2808 times)

0 Members and 2 Guests are viewing this topic.

bryce910

  • Newbie
  • *
  • Posts: 31
    • View Profile
IOS Linker issue
« on: March 05, 2016, 05:43:55 am »
Hey everyone!

So I have been working on getting an ios build up and running and after I have my max OSX up and running correctly. However, I am having an issue with linking up with the ios port.

Code: [Select]
Ld Debug/cocoa.app/Contents/MacOS/cocoa normal x86_64
    cd /Users/example/Desktop/cocoa
    export MACOSX_DEPLOYMENT_TARGET=10.10
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/example/Desktop/cocoa/Debug -F/Users/example/Desktop/cocoa/Debug -filelist /Users/example/Desktop/cocoa/Project.build/Debug/cocoa.build/Objects-normal/x86_64/cocoa.LinkFileList -mmacosx-version-min=10.10 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -framework Cocoa -framework Foundation -lsfml-system -lsfml-window -lsfml-graphics -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/example/Desktop/cocoa/Project.build/Debug/cocoa.build/Objects-normal/x86_64/cocoa_dependency_info.dat -o /Users/example/Desktop/cocoa/Debug/cocoa.app/Contents/MacOS/cocoa

ld: library not found for -lsfml-system
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Apparently I have no idea what I am doing and do not fully understand where it is actually looking for the sfml-system file at?


Thanks for the help!
Bryce

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: IOS Linker issue
« Reply #1 on: March 05, 2016, 02:15:53 pm »
You're targeting OS X or iOS? Because that snippet is related to OS X, not iOS, AFAIK.
SFML / OS X developer

bryce910

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: IOS Linker issue
« Reply #2 on: March 05, 2016, 03:11:10 pm »
The target is supposed to be iOS, I used the example and set the IOS = true and then opened the project and then compile "cocoa"

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: IOS Linker issue
« Reply #3 on: March 05, 2016, 03:18:06 pm »
I haven't used SFML on iOS so far and have no idea what this "cocoa" project you're referring to, but you should probably start with a fresh project for iOS.
SFML / OS X developer

bryce910

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: IOS Linker issue
« Reply #4 on: March 05, 2016, 03:33:53 pm »
The cocoa project is in the examples project. This actually is a completely new application just implementing the cocoa example that is on the github.  I don't plan on doing anything custom till I get the example up and running lol

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: IOS Linker issue
« Reply #5 on: March 05, 2016, 04:20:41 pm »
You mean this one: https://github.com/SFML/SFML/tree/master/examples/cocoa ?

This is for OS X. Cocoa is a library for OS X. There's Cocoa Touch for iOS, but I'm not aware of any sample on SFML's github.
SFML / OS X developer

bryce910

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: IOS Linker issue
« Reply #6 on: March 05, 2016, 04:30:57 pm »
Oh crap. Then I have been wasting my time on that because my stuff already works on OSX! Lol

May I ask where the iOS data on github is?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: IOS Linker issue
« Reply #7 on: March 05, 2016, 05:50:48 pm »
The iOS port is not as advanced nor supported as the rest of SFML, actually. There's no specific example in SFML codebase for iOS at the moment.

You can find a bit of information here and there on the forum, but be careful as some information might be outdated. For example:


How to compile the iOS port?

To compile the iOS port, you must use the Xcode generator of CMake, and define the "IOS" boolean variable (set to TRUE) before configuring for the first time. The generated projects can then be compiled for x86 (simulator) or armv6/v7 (device) by selecting the target in Xcode; no need to generate multiple builds for that. SFML is built as static libraries on iOS (this is the only option for this OS).

To use SFML in your iOS app project, do as usual: add the include path to your project settings, and drag'n'drop the libraries into your project. Since SFML is linked statically, you'll have to link all its non-default dependencies as well (extlibs/libs-ios).
Note that you'll need a registered Apple developer account in order to copy and run your app on a device; otherwise the simulator will be your only choice.

[...]

General things to know

The sensors (accelerometer, gyroscope, compass, ...) are currently using the Joystick API (see the sources for more detail about the mapping). We'll soon add a sf::Sensor API that better matches the requirements.

The foreground / background events are mapped to the GainedFocus and LostFocus events.

Orientation changes are mapped to the Resize event.

sf::Shader is not available, because the implementation is based on OpenGL ES 1. Shaders are only available in OpenGL ES 2, which would require a major rewriting of the graphics part. So that won't be done in a near future.

Things to know for iOS

On iOS, the working directory is automatically set to the resources directory.

[...]

The implementation should be compatible with iOS 4.0 and more.

The size of the window is ignored, the screen size is always used.

Examples are not available. It seems that CMake is not ready for that, it still requires too many hacks, and even with them, it was still pretty bad.

The ugly hack: you need to include <SFML/Main.hpp> in the file where your main function is defined. This is because SFML has to hijack it, and rename your own main to call it later.

There's no specific support for high-resolution (retina) screens, they currently produce the same output as low-res screens (this will be done later).

[...]

Note: if you manage to set it up correctly and run a simple program, you could write something and post it there: https://github.com/SFML/SFML/wiki/Tutorials#configuration
SFML / OS X developer