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 - prchakal

Pages: 1 2 [3] 4 5 ... 10
31
General / Re: Link problem with SFML2
« on: May 17, 2013, 07:18:28 pm »
Ok.

I already do it and work it.

But i have another problem (i think that is the last). I need add two framework to binary execute(sndfile and freetype). I can compile without it and it generate the binary, but when execute i got error that sndfile and freetype is not linked.

So to solve, i add the sndfile and freetype framework and made a new cmakelists. But if i put:

Quote
target_link_libraries(${PROJECT_NAME} ${EXTRA_TARGET_LINK_LIBRARIES} ${SFML_LIBRARIES} ${SNDFILE_LIBRARY} ${FREETYPE_LIBRARY})

The final command to link is:

Quote
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/sfml-project.dir/link.txt --verbose=1
/usr/bin/c++   -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/sfml-project.dir/main.cpp.o CMakeFiles/sfml-project.dir/Engine.cpp.o CMakeFiles/sfml-project.dir/Util.cpp.o CMakeFiles/sfml-project.dir/ResourcePath.mm.o  -o sfml-project.app/Contents/MacOS/sfml-project  -F/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/freetype/mac/lib  -framework Foundation ../library/sfml/mac/lib/libsfml-audio.dylib ../library/sfml/mac/lib/libsfml-graphics.dylib ../library/sfml/mac/lib/libsfml-network.dylib ../library/sfml/mac/lib/libsfml-system.dylib ../library/sfml/mac/lib/libsfml-window.dylib -framework sndfile -framework freetype
ld: framework not found sndfile

In red you see that cmake only add a -F command to freetype.

So, if i remove freetype from target_link_libraries, like this:

Quote
target_link_libraries(${PROJECT_NAME} ${EXTRA_TARGET_LINK_LIBRARIES} ${SFML_LIBRARIES} ${SNDFILE_LIBRARY})

I get:

Quote
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/sfml-project.dir/link.txt --verbose=1
/usr/bin/c++   -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names   CMakeFiles/sfml-project.dir/main.cpp.o CMakeFiles/sfml-project.dir/Engine.cpp.o CMakeFiles/sfml-project.dir/Util.cpp.o CMakeFiles/sfml-project.dir/ResourcePath.mm.o  -o sfml-project.app/Contents/MacOS/sfml-project  -F/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sndfile/mac/lib  -framework Foundation ../library/sfml/mac/lib/libsfml-audio.dylib ../library/sfml/mac/lib/libsfml-graphics.dylib ../library/sfml/mac/lib/libsfml-network.dylib ../library/sfml/mac/lib/libsfml-system.dylib ../library/sfml/mac/lib/libsfml-window.dylib -framework sndfile
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/lib /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Frameworks
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sndfile/mac/lib /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Frameworks
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/freetype/mac/lib /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Frameworks
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E make_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Resources/js
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E copy_directory /Users/paulo/Documents/workspaces/cpp/sfml-cmake/resources /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/sfml-project.app/Contents/Resources
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles  1 2 3 4
[100%] Built target sfml-project

As you see, the -F command is to sndfile and the compilation was done.

So, how i can add parameter to sndfile and freetype framework path?

32
General / Re: Link problem with SFML2
« on: May 17, 2013, 06:27:50 pm »
I made a modified file CMakeLists more organized.

But i have the problem now:

Quote
CMake Error at CMakeLists.txt:66 (target_link_libraries):
  Cannot specify link libraries for target "sfml-project" which is not built
  by this project.

The line that generate the error is:

Quote
target_link_libraries(${PROJECT_NAME} ${EXTRA_TARGET_LINK_LIBRARIES} ${SFML_LIBRARIES})

33
General / Re: Link problem with SFML2
« on: May 17, 2013, 05:42:43 pm »
I revert to:

Quote
find_package(SFML COMPONENTS audio network graphics window system REQUIRED)

The same problem :(

One question: I need add the sndfile and freetype to my SFML2 project?

34
General / Link problem with SFML2
« on: May 17, 2013, 05:06:01 pm »
Hi,

I have a link problem im my temporary project:
https://github.com/prsolucoes/sfml-cmake-temp

The problem is when the compiler will link the libraries SFML2.

Can anyone analyse the CMakeLists.txt to see if find the problem to help me?

To test it, you only need:

1 - Download from github
2 - cd build
3 - ./rebuild.sh

My log:

Quote
Paulos-MacBook-Pro:build paulo$ ./rebuild.sh
-- The C compiler identification is Clang 4.2.0
-- The CXX compiler identification is Clang 4.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found SFML . in /Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -H/Users/paulo/Documents/workspaces/cpp/sfml-cmake -B/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_start /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make -f CMakeFiles/sfml-project.dir/build.make CMakeFiles/sfml-project.dir/depend
cd /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build && /usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_depends "Unix Makefiles" /Users/paulo/Documents/workspaces/cpp/sfml-cmake /Users/paulo/Documents/workspaces/cpp/sfml-cmake /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/DependInfo.cmake --color=
Dependee "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/DependInfo.cmake" is newer than depender "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/depend.internal".
Dependee "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles/sfml-project.dir/depend.internal".
Scanning dependencies of target sfml-project
make -f CMakeFiles/sfml-project.dir/build.make CMakeFiles/sfml-project.dir/build
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 1
[ 25%] Building CXX object CMakeFiles/sfml-project.dir/main.cpp.o
/usr/bin/c++    -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include    -o CMakeFiles/sfml-project.dir/main.cpp.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/main.cpp
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 2
[ 50%] Building CXX object CMakeFiles/sfml-project.dir/Engine.cpp.o
/usr/bin/c++    -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include    -o CMakeFiles/sfml-project.dir/Engine.cpp.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/Engine.cpp
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 3
[ 75%] Building CXX object CMakeFiles/sfml-project.dir/Util.cpp.o
/usr/bin/c++    -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include    -o CMakeFiles/sfml-project.dir/Util.cpp.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/Util.cpp
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_progress_report /Users/paulo/Documents/workspaces/cpp/sfml-cmake/build/CMakeFiles 4
[100%] Building CXX object CMakeFiles/sfml-project.dir/ResourcePath.mm.o
/usr/bin/c++    -g -I/Users/paulo/Documents/workspaces/cpp/sfml-cmake/library/sfml/mac/include    -o CMakeFiles/sfml-project.dir/ResourcePath.mm.o -c /Users/paulo/Documents/workspaces/cpp/sfml-cmake/ResourcePath.mm
Linking CXX executable sfml-project.app/Contents/MacOS/sfml-project
/usr/local/Cellar/cmake/2.8.10.2/bin/cmake -E cmake_link_script CMakeFiles/sfml-project.dir/link.txt --verbose=1
/usr/bin/c++   -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -framework Foundation -w CMakeFiles/sfml-project.dir/main.cpp.o CMakeFiles/sfml-project.dir/Engine.cpp.o CMakeFiles/sfml-project.dir/Util.cpp.o CMakeFiles/sfml-project.dir/ResourcePath.mm.o  -o sfml-project.app/Contents/MacOS/sfml-project  ../library/sfml/mac/lib/libsfml-system.dylib ../library/sfml/mac/lib/libsfml-window.dylib ../library/sfml/mac/lib/libsfml-graphics.dylib ../library/sfml/mac/lib/libsfml-network.dylib ../library/sfml/mac/lib/libsfml-audio.dylib
Undefined symbols for architecture x86_64:
  "sf::String::String(std::string const&, std::locale const&)", referenced from:
      Engine::initializeGraphics() in Engine.cpp.o
  "sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)", referenced from:
      Engine::run() in Engine.cpp.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]: *** [sfml-project.app/Contents/MacOS/sfml-project] Error 1
make[1]: *** [CMakeFiles/sfml-project.dir/all] Error 2
make: *** [all] Error 2


35
General / Re: sf::Thread is blocking main thread
« on: September 19, 2012, 04:56:20 pm »
Hi Laurent,

In that my program with V8, i use scripts to update "player1" and "player2", but i need run it in threads and leave the SFML render in main thread.

I need launch one thread for each player without block main thread that will render everything.

Imagine 100 players and each player a new thread that will update this players.

Is the same concept of ROBOCODE (http://robocode.sourceforge.net/).

36
General / Re: sf::Thread is blocking main thread
« on: September 19, 2012, 02:52:14 pm »
So,

I see it yesterday, if i extend it and rewrite destructor solve, right?


37
General / sf::Thread is blocking main thread
« on: September 19, 2012, 05:58:19 am »
Hi,

I create a sample code to illustrate my problem:

Quote
void threadMethod()
{
    while(true){}
}

int main()
{
    sf::Thread thread(&threadMethod);
    thread.launch();

    return EXIT_SUCCESS;

}

When thread start, the process stop/lock until threadMethod exit (in this example, never).

Why it happen if thread is another "process"? The correct is thread start and program finish on "return EXIT_SUCESS". No?

38
General / Re: SFML + V8 + Threads - How to?
« on: September 18, 2012, 02:57:56 am »
The problem of lag i solve, sleep function is waiting 1sec and not 1 ms, but the sfml is rendering so strange the images and nothing was changed about it.


39
General / Re: SFML + V8 + Threads - How to?
« on: September 18, 2012, 12:12:10 am »
Hum..

I refactored the code and now it is organized.

The problem now is two:

1 - The sprites are rendered with problem
2 - On each main loop we have a lag

[screenshot attached]


@Groovy

But i can load and execute it on a context that runs only in the thread? Because i only need execute it to the scripts modify the object. So everything can be in a thread. It is true?

[attachment deleted by admin]

40
General / Re: SFML + V8 + Threads - How to?
« on: September 17, 2012, 07:59:50 pm »
Hi Laurent,

Now it is running with threads(already commited working version), but it is so slowly, and i dont know if it is because v8 or sfml or anything process that is locking the app.

If it is on thread, the main thread dont stop and if you see on log, it print the message "::start" (this is printed  by start method) too slow. It is not on thread, because the main thread wait it finish to call again. If threads working correct, the main loop is create too many threads and we will see some "::start" on log.

Agree?

41
General / Re: SFML + V8 + Threads - How to?
« on: September 17, 2012, 04:09:28 pm »
When i open, is because i dont know.

And after i discover the problem, i share here to others that have the same problem see and learn too.

sorry.

42
General / SFML + V8 + Threads - How to?
« on: September 17, 2012, 06:58:16 am »
Hi,

I made a simple thread example using SFML, V8 and SF::THREAD.

The problem is when the thread is executed, my program quit with message "segmentation fault: 11".

I only execute the same method to read a JS and execute it, but on another method by thread.

You can see example here:
https://github.com/prsolucoes/sfml-cmake

To use thread method, change var:
Quote
bool useThread = false;

to:
Quote
bool useThread = true;

In "main.cpp" file.

The method that thread call is the same of main loop code without thread:

Quote
void start()
{
    v8::HandleScope handleScope;
    v8::Handle<v8::String> source = readFile(resourcePath() + "/js/robot1.js");
    v8::Handle<v8::Script> script = v8::Script::Compile(source);
    v8::Handle<v8::Value> result = script->Run();
}

Thanks for any help.

43
General / Re: SFML and V8 - Javascript doesnt know c++ objects
« on: September 16, 2012, 11:16:48 pm »
Hi,

Problem solved.

After try too many things and analyse other codes and v8, i see that i forgot one thing, put the reference of my method on REGISTER method.

Problem solved and commited to github.

44
General / SFML and V8 - Javascript doesnt know c++ objects
« on: September 16, 2012, 07:25:07 pm »
Hi ppl,

I made with help of people from here a running version of a program that integrate v8 and sfml.

But my problem now is that javascript doesnt know my objects and get an error on console when i execute the program:

Quote
<unknown>:232: Uncaught TypeError: Object [object Object] has no method 'walkForward'

But my class is created as same of sf_v8 classes.

You can see here:
https://github.com/prsolucoes/sfml-cmake

My class that is sent to v8:
Quote
https://github.com/prsolucoes/sfml-cmake/blob/master/JSCharacter.h

And my main file that send it to v8:
Quote
https://github.com/prsolucoes/sfml-cmake/blob/master/main.cpp
LINES: 86:92

Thanks.

45
Graphics / Re: Sprite as attribute doesnt Draw but local sprite Draw
« on: September 16, 2012, 07:15:38 pm »
Humm ok.

But, can you explain me why it is bad? Only to i understand, please :)

Pages: 1 2 [3] 4 5 ... 10