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

Pages: [1]
1
Graphics / Re: Failed to load image in MSVC
« on: October 21, 2022, 06:46:35 am »
Really many-many thanks. I assume that this is an offtopic about MSVC not SFML, but your answer with looking on projects settings from https://www.sfml-dev.org/download/sfml/2.5.1/ after CMake help so much.

2
Graphics / Failed to load image in MSVC
« on: October 20, 2022, 02:09:38 pm »
This
t1.loadFromFile("images/red.png");
:
1. Compiles.
2. Runs from Debug or Release directory.
3. Doesn't run inside MSVC.

This
t1.loadFromFile("C:\\Users\\User\\source\\repos\\SFMLtest\\x64\\Debug\\images\\red.png");
 
:
Works correctly in all cases.

Can somebody tell how to do it properly?

3
General / Re: MSVC LINK1104 cannot open file 'sfml-graphics-d.obj'
« on: October 20, 2022, 01:38:43 pm »
This was my fault. I forgot to write .lib in Additional Dependencies sfml-system-d.lib and couldn't find this a several hours. Thanks for answer!

4
General / MSVC LINK1104 cannot open file 'sfml-graphics-d.obj'
« on: October 20, 2022, 01:19:22 pm »
MSVC LINK1104 cannot open file 'sfml-graphics-d.obj' in Debug mode.
MSVC LINK1104 cannot open file 'sfml-graphics-d.obj' in Release mode.

Could you answer what it is? Why this is every time wrong?

SFML source / CMake GUI / ignore Build_type / all by default (settings for dynamic linking) / MSVC / Debug / build (-d.lib and -d.dll)/ Release / build ( .lib and .dll) / All ok.

SFML test / all settings from https://www.sfml-dev.org/tutorials/2.5/start-vc.php / all paths correspond

Why does MSVC want .obj ? It is really pain.

5
I think I understand and my assumption was right. Many thanks.

6
General / Re: How do .lib and .dll work on Win?
« on: October 14, 2022, 04:41:11 am »
Brilliant answer! Thank you.

7
General / What is wrong with examples in Source SFML?
« on: October 13, 2022, 06:07:35 pm »
Sorry for wall of text. I want to run pong example project from SFML .sln project.

Please, I really tried many times, but cannot understand what is wrong with https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip.

My staff:

win10, CMake 3.2.2.1, MSVC 17.35 (2022), SFML 2.5.1.

My steps:

Downloaded sources.

Fed them to the CMake.
CMAKE_BUILD_TYPE: Release (ignored it due to https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php).
SFML_BUILD_EXAMPLES: yes.
Other options left by default.
Configure, generate.

Opened MSVC.
Left all project settings by default.
Built ALL_BUILD Debug and Release.
Went to Common properties, set startup project, Current selection, select pong project.

I tried to RUN pong debug version and got "missed sfml-window-d-2.dll" and audio, graphics, system.
I tried to run pong release version and got the same, but  sfml-window-2.dll.

What is wrong? All settings in project look correctly! C/C++ and Linker nodes look correctly! They lead to sfmlb\lib\Debug and sfmlb\lib\Release respectively to Debug and Release configuration ( https://www.sfml-dev.org/tutorials/2.5/start-vc.php#top:-X

Of course, if I manually add these .dll in pong/debug and pong/release (and supplied with correspond resource folder) - it works! But indeed - it is bad manually solution.



8
But why are there images in this compiled libraries https://www.sfml-dev.org/files/SFML-2.5.1-windows-vc15-64-bit.zip ? Just because someone added them manually?
For example: SFML-2.5.1-windows-vc15-64-bit\SFML-2.5.1\examples\pong\resources, so pong.exe can be run immediately (it is very convenience!).

9
General / Why are there no resources folder in example (opengl or pong)?
« on: October 13, 2022, 07:52:01 am »
https://www.sfml-dev.org/download/sfml/2.5.1/ ---> Source code ---> CMake (SFML_BUILD_EXAMPLES) ---> MSVC ---> build.
Then \examples\opengl\Debug will not have resource folder with background.jpg, sansation.ttf and sansation.jpg.
Have I lost something?

10
General / How do .lib and .dll work on Win?
« on: October 13, 2022, 07:32:18 am »
Suppose, I compiled SFML with CMake and MinGW.
Now I have .lib and .dll libraries.

I create main.cpp, add #include and want to compile with mingw32-make.
all: compile link
compile:
        g++ -c main.cpp -I "C:\Users\G\Downloads\SFML-2.5.1\include"
link:
        g++ main.o -o main -L "C:\Users\G\Downloads\SFML builds\lib" -l sfml-graphics -l sfml-window -l sfml-system
 

Do I understand correctly that .lib files are using like a wrapper on linking stage for future working with .dll files?

11
General / Re: MinGW-W64 8.1.0 can't compile SFML from git
« on: July 04, 2022, 09:08:06 am »
Thank you very much! I'm just studying all of it (c++, git, cmake) and your answer saved a ton of time!

12
General / MinGW-W64 8.1.0 can't compile SFML from git
« on: July 04, 2022, 08:07:43 am »
The first way is ok:

The second way is not:

$ mingw32-make
Consolidate compiler generated dependencies of target sfml-system
[  1%] Building CXX object src/SFML/System/CMakeFiles/sfml-system.dir/FileInputStream.cpp.obj
In file included from C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/filesystem:37,
                 from C:/Users/G/gitreps/SFML/include/SFML/System/FileInputStream.hpp:37,
                 from C:\Users\G\gitreps\SFML\src\SFML\System\FileInputStream.cpp:28:
C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/fs_path.h: In member function 'std::filesystem::__cxx11::path& std::filesystem::__cxx11::path::operator/=(const std::filesystem::__cxx11::path&)':
C:/PROGRA~1/MINGW-~1/X86_64~1.0-W/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/bits/fs_path.h:237:47: error: no match for 'operator!=' (operand types are 'std::filesystem::__cxx11::path' and 'std::filesystem::__cxx11::path')
    || (__p.has_root_name() && __p.root_name() != root_name()))
                               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
and others
 

Why is that?

Pages: [1]
anything