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.


Messages - Salepate

Pages: [1]
1
General / Can't Link SFML 2.0 on Mac OSX 10.7.2
« on: November 02, 2011, 12:12:48 am »
Hu? I proceeded to make install (with sudo), do I really need to check that folder too?

I'll start from scratch again and report here when I'm done

2
General / Can't Link SFML 2.0 on Mac OSX 10.7.2
« on: November 01, 2011, 09:47:41 pm »
Quote from: "Hiura"
These two posts are not related.

You're doing the compilation wrong. Instead to give the linker optionS to your compiler when compiling the two source files you should pass these options when "merging" the object files together.


Yeah, i'd fixed that. .

Right now, i'm still getting the "undefined symbols for architecture" error message, that's if I don't give options
Code: [Select]
-lsfml-graphics -lsfml-window -lsfml-system
 when merging object files together. (these options wont let it work saying that library -lsfml-graphics wasn't found)

And here's my current Makefile
Code: [Select]

# Tools
CXX= g++
CFLAGS= -Wall -ansi
CLIBS = -lsfml-graphics -lsfml-window -lsfml-system

# Dirs
SRCDIR= src/
INCDIR= include/
OBJDIR= obj/

# Files
CPPFILES= $(shell (for f in $$(find ./$(SRCDIR) -type f -name *.cpp); do basename $$f; done;))
OBJFILES= $(CPPFILES:.cpp=.o)

# Output
BIN= td610

###############################################################################
# Rules
###############################################################################
vpath %.cpp $(SRCDIR)

all: $(OBJFILES)
$(CXX) -o $(BIN) $(addprefix $(OBJDIR),$(OBJFILES)) $(CFLAGS) $(CLIBS)


%.o: %.cpp
@echo "\033[32mbuilding $@ ($<)\033[0m"
@mkdir -p obj
$(CXX) -o $(OBJDIR)$@ -c $< $(CFLAGS) -I$(INCDIR)


# Cleaning !
.PHONY: clean cleanall

clean:
rm -rf $(OBJDIR)

cleanall: clean
rm -f $(BIN)


Might I be missing something ?

3
General / Can't Link SFML 2.0 on Mac OSX 10.7.2
« on: November 01, 2011, 12:08:55 pm »
In fact, i haven't been fixing anything at all, it just happened to work on another Mac Os X.

the warnings i keep gettings are those like
Code: [Select]

linker input file unused because linking not done


and, no matter the way I build SFML libs,  I won't be able to compile any project that use them, i can't get rid of the undefined symbols errors
Code: [Select]

Undefined symbols for architecture x86_64:


Edit: It seems like someone else has the same errors, i might find what I need here
http://www.sfml-dev.org/forum/viewtopic.php?t=6162

I'll keep you informed

4
General / Problem with tac tac toe
« on: October 31, 2011, 01:19:27 am »
you have a bad prototype
Code: [Select]

int paintfield(sf::RenderWindow App, sf::Sprite fieldsprite[3][3], sf::Image tuscia, sf::Image imageO, sf::Image imageX)


the first argument should be a reference, otherwise it would try copying your RenderWindow, which is unrequired

Code: [Select]

int paintfield(sf::RenderWindow &App, sf::Sprite fieldsprite[3][3], sf::Image tuscia, sf::Image imageO, sf::Image imageX)

even if it works, the way you pass arguments is quite wrong

5
General / Can't Link SFML 2.0 on Mac OSX 10.7.2
« on: October 30, 2011, 01:17:53 pm »
[updated]

Hey,

i've been trying to make SFML works, but all in vain.

I first tried with the SFML 2.0 snapshot, and then with the SFML git

So here's what i've done:

I retrieved the whole repository. and then used cmake. While doing cmake, the only warnings that i got were about some unbound keycodes. Otherwise it was successful. libs were created in SFML/lib (i tried both static & dynamic libs)
So here's the content of SFML/lib/ :
Code: [Select]

libsfml-audio-s.a libsfml-graphics.dylib libsfml-system.2.dylib
libsfml-audio.2.0.dylib libsfml-network-s.a libsfml-system.dylib
libsfml-audio.2.dylib libsfml-network.2.0.dylib libsfml-window-s.a
libsfml-audio.dylib libsfml-network.2.dylib libsfml-window.2.0.dylib
libsfml-graphics-s.a libsfml-network.dylib libsfml-window.2.dylib
libsfml-graphics.2.0.dylib libsfml-system-s.a libsfml-window.dylib
libsfml-graphics.2.dylib libsfml-system.2.0.dylib


here's what my Makefile project looks like:
Code: [Select]


# Tools
CXX=            g++
CFLAGS=         -Wall -ansi -lsfml-graphics
CLIBS =         -lsfml-graphics -lsfml-window -lsfml-system

# Dirs
SRCDIR=         src/
INCDIR=         include/
OBJDIR=         obj/

# Files
CPPFILES=       $(shell (for f in $$(find ./$(SRCDIR) -type f -name *.cpp); do basename $$f; done;))
OBJFILES=       $(CPPFILES:.cpp=.o)

# Output
BIN=            td610

###############################################################################
# Rules
###############################################################################
vpath   %.cpp $(SRCDIR)

all:    $(OBJFILES)
        $(CXX) -o$(BIN) $(addprefix $(OBJDIR),$(OBJFILES))


%.o:    %.cpp
        @echo "building $@ ($<)"
        @mkdir -p obj
        $(CXX) -o $(OBJDIR)$@ -c $< $(CFLAGS) $(CLIBS) -I$(INCDIR) -L/Users/Willy/Dev/SFML/lib/


And here's the result when I start compiling
Code: [Select]

building game.o (src/game.cpp)
g++ -o obj/game.o -c src/game.cpp -Wall -ansi -lsfml-graphics -lsfml-graphics -lsfml-window -lsfml-system -Iinclude/ -L/Users/Willy/Dev/SFML/lib/
i686-apple-darwin11-llvm-g++-4.2: -lsfml-graphics: linker input file unused because linking not done
i686-apple-darwin11-llvm-g++-4.2: -lsfml-graphics: linker input file unused because linking not done
i686-apple-darwin11-llvm-g++-4.2: -lsfml-window: linker input file unused because linking not done
i686-apple-darwin11-llvm-g++-4.2: -lsfml-system: linker input file unused because linking not done
building main.o (src/main.cpp)
g++ -o obj/main.o -c src/main.cpp -Wall -ansi -lsfml-graphics -lsfml-graphics -lsfml-window -lsfml-system -Iinclude/ -L/Users/Willy/Dev/SFML/lib/
i686-apple-darwin11-llvm-g++-4.2: -lsfml-graphics: linker input file unused because linking not done
i686-apple-darwin11-llvm-g++-4.2: -lsfml-graphics: linker input file unused because linking not done
i686-apple-darwin11-llvm-g++-4.2: -lsfml-window: linker input file unused because linking not done
i686-apple-darwin11-llvm-g++-4.2: -lsfml-system: linker input file unused because linking not done
g++ -o td610 obj/game.o obj/main.o
Undefined symbols for architecture x86_64:
  "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
      _main in main.o
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, sf::ContextSettings const&)", referenced from:
      _main in main.o
  "sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)", referenced from:
      _main in main.o
  "sf::RenderTarget::Clear(sf::Color const&)", referenced from:
      _main in main.o
  "sf::Window::Display()", referenced from:
      _main in main.o
  "sf::Window::IsOpened() const", referenced from:
      _main in main.o
  "sf::RenderWindow::~RenderWindow()", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [all] Error 1


Not to forget my main.cpp:
Code: [Select]

#include <iostream>
#include <SFML/Graphics.hpp>

using namespace sf;

int main(int argc, char **argv) {
        RenderWindow win( VideoMode(800, 600, 32), "test");
        while ( win.IsOpened() ) {
                win.Clear();
                win.Display();
        }
        return 0;
}                    


I'm not really experienced with Mac stuff, since I do not own any.

I just took a look at the System information and here's what I get :
Code: [Select]

Model Name: MacBook
  Model Identifier: MacBook6,1
  Processor Name: Intel Core 2 Duo
  Processor Speed: 2,26 GHz
  Number of Processors: 1
  Total Number of Cores: 2
  L2 Cache: 3 MB
  Memory: 4 GB
  Bus Speed: 1,07 GHz


I can't tell if it's a 64bits architecture nor a 32bits. I'd say it's a 64 one

Any help would be appreciated,

Salepate

Edit: I just happened to fix the undefined references, it now works but i still get those warnings. might I just ignore it?

6
Graphics / Color problems
« on: October 13, 2010, 01:57:24 pm »
Well, I just figured out the problem,

I was resizing the Shape in between the two SetColor() calls, without using Color::White.

I'm sorry for the trouble! (I'll have to admit that I just found out there was a difference between the SetColor() function and the initial color given to the shape, though)

Have a good day.

7
Graphics / Color problems
« on: October 13, 2010, 01:45:52 pm »
Hey, I've been manipulating Shapes and colors recently and it seems like I don't get something.

When I create my shapes, I always use Color::White, then by using SetColor(), I change its color to the one I want

Code: [Select]

// col is a given parameter : const Color &col
    Color _sColor = col;
    Shape _shape = Shape::Rectangle(0, 0, _size.x, _size.y, Color::White, 1, Color::Black);
    _shape.SetColor(col);


That's working perfectly, but for some unknown reasons, if I try to apply again the same color, it gets darker.

Code: [Select]

_shape.SetColor(_sColor);


I've been double checking what I've done wrong, but I can't see the problem.

Any help would be appreciated, thanks!

Pages: [1]
anything