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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Dooskington

Pages: [1]
1
General / Load resources in app bundle
« on: September 20, 2015, 08:05:38 pm »
I compile and bundle my SFML application into a .app, and then I run the app by typing open Orbs.app.
What I cannot figure out, however, is the working directory so that I can load a font. I copy a font to the Resources folder of the app during compilation, but the app can't find it. I thought that the default working directory of an SFML app was the resources folder?

Here is my folder structure:

Orbs.app
    Contents
        Mac OSX
            main (main binary)
        Resources
            SFML stuff
            geometos.ttf
            icon.icns
    info.plist

I want to be able to load the geometos.ttf font, but font.loadFromFile("geometos.ttf") cannot find the font. What do I have to do?

2
General / Building SFML game with makefile issue
« on: September 18, 2015, 01:09:46 am »
I'm having somewhat of an issue with building my SFML project. I am on Mac OSX.

It is building and running just fine, but only if I have the lib folder under /usr/local/lib. I don't want this dependency. I want to just be able to run the program on its own, referencing the lib folder that it builds from. Here is my makefile:

CC = clang++
C_FLAGS = -Wall
INCLUDE_PATH = include/
LIB_PATH = lib/
LIBS = -lsfml-system -lsfml-graphics -lsfml-window -lsfml-audio

all: collector

collector: Main.o
        $(CC) -o collector Main.o -L$(LIB_PATH) $(LIBS)

Main.o: Main.cpp
        $(CC) -c Main.cpp -o Main.o -I$(INCLUDE_PATH)

clean:
        rm -f collector *.o
 

With this makefile, it compiles with the includes in my project folders include/ directory, and the libs in my project folders lib/ directory. However, when it comes to running, it will only run if, like I said before, I have the lib folder in /usr/local/. If it is not there, I get this error:

dyld: Library not loaded: @rpath/libsfml-system.2.3.dylib

How do I fix this? I do not want to use the Frameworks, so please don't point me to those.

Also, I understand that SFML requires some external dependencies that I have placed in Library/Frameworks. Is there any way to move those into my project directory for building as well? I just want to have all SFML files tied to my project, hands down.

Pages: [1]