Heck yeah man you saved my life. I was so frustrated because all those other tutorials just didn't work but yours is perfect in any way. Immediatly subscribed!
You did a great job explaining and i hope you continue making tutorials. Besides getting SFML setup ilearned about Makefiles and it ACTUALLY worked which was not the case in the other videos. (please excuse spelling/grammar mistakes im german :) )
Hi all, sorry for being away for some time, I am planning on creating and releasing the first of the game engine video soon. I recorded the video a couple times but was unsatisfied by how it would turn out and how long the videos were, so I am going to write a script in order to cut down the video time and include challenges. I will try to create and release the video soon.
Thank you :). I am planning on making a series where we build a game engine (and to test it out, some games). I recorded the next video, but it was 50 minutes long and I want to make them around 15 min each. My plan is to create a main video where we build the game engine, and short sub videos (like 5 min each) explaining the different topics. It might be a couple of weeks till the next video though because I need to get on top of my college classes :)
love you, bro... :) Edit: We can also do one thing more instead of putting the "bin/*.*" files in the current project folder we can add that bin directory to the environment variable too. or just put these files in the MinGW bin folder... Now we don't have to create a mesh every time we create a new project folder...
why i get error : the procedure entry point __gxx_personality_seh0 could not be located in the dynamic link library .....\sfmlProject\sfml-graphics-2.dll? can anyone help me, i have very hard to solve this error
I would try [ctrl] + [shift] + [p] then type c/c++ and click on the ui option if there is one, then set the compiler to g++ from where you have it installed. If that doesn't work, please let me know
@@hizonopusdie I believe there is a way to set it as the default within your vs code main settings. You go to vs code main setting page, then click on the c++/c section and I think it will give you the option to set a default compiler path. I think that should fix it permanently, though I am not sure. I recently learned a way to include all the files needed for sfml within the project directory and because it is in the workspace folder intellisence usually picks up on it. I set it up in the new way on the game engine series I am working on.
Hello, great tutorial but I ran into one problem, when I try and create the main.exe file I keep getting the same message that says: c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0\libsfml-system.a when searching for -lsfml-system This line repeats a couple times and then it gives me the following line: c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-system I have the same issue for -lsfml-window and -lsfml-graphics as well. I saw you respond to someone having the same issue as me so I tried using the -L{where the lib is} line that you said to do and I got the same issue. Any help would be greatly appreciated!
The first line is the command I used initially and the second line is the line I also tried but still got nothing: g++ *.o -o main -lsfml-graphics -lsfml-window -lsfml-system g++ main.o -o main -LC:\SFML-2.5.1-windows-gcc-7.3.0-mingw-32-bit\SFML-2.5.1\lib -lsfml-graphics -lsfml-window -lsfml-system
Sorry for the late response, youtube has stopped notifying me when people comment. This could be due to a different name of the .a differs from sfml-system, or it could be dlls are needed in the same dir as your exe. If you have discord and want to debug, you can dm me at HerbGlitch#5572 and I am down to help debug
Great tutorial! Is there going to be a follow up to this one? Btw try making the sound louder in whatever video editor you use I can't really hear you unless I go to 100% volume
Thank you. I really want to create a new video about building a game or game engine. I am trying to figure out how best to teach the topics. Idk at what level I would be best at teaching or what concepts would be best to go through. I bought a new mic for next time I record to hopefully fix the volume. One disclaimer is most of my attention and time are focused on college and pocketcampaigns.org. If anyone has any suggestions for what they would like to learn, please let me know. I try to check this comment section often :)
When I pasted the test code in vs code, it's showing a red line (error) at #include . In the problems tab it says "#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit "(and then my project folder where my main.cpp exists). And it shows another error that says "cannot open source file "SFML/Graphics.hpp"". I've tried to setup sfml for 2 weeks now and I don't know what to do. Any help really appreciated! :)
Sorry for not responding sooner. I have been moving all day. Can you check in settings if you have mingw as your default Compiler with the correct path? I have posted a 3-4 min video for in project setup and it guides through vs codes settings for mingw
@@herbglitch thanks for your reply, I wrote "C:/MinGW/bin/g++.exe on the compilerPath and "${workspaveFolder}/**" on the includePath, but when I go back to my main.cpp it still shows an error at the include line like before. Thanks again for your reply! :)
@@mikael808 Hmm.. Do you have the sfml folders in the project directory? or, do you have a project .vscode file that is pathing incorrectly? If you want to debug and fix this sometime, I can live share or talk over discord or smthn. Just let me know :)
hello i´ve got a problem. when i copy paste the main cpp code from the sfml page. visual code show this two errors #Include errors have been detected. Update the value of includePath. Wavy underline is disabled for this translation unit (C: \ sfml project \ main.cpp) cannot open source file (error code "SFML / Graphics.hpp"). sorry for my primitive english
Hey so I've been trying to do this in atom, and I'm not having any success. I'm getting this error: "main.cpp:1:10: fatal error: SFML/Graphics.hpp: No such file or directory #include ^~~~~~~~~~~~~~~~~~~ compilation terminated." If you need more info reply and tell me what it is, I have the dll files in. The command I ran was: "g++ -c main.cpp" I also tried: "g++ main.cpp -lsfml-graphics -lsfml-window -lsfml-system"
can you try to update which compiler intellisense is using for vscode? [ctrl] + [shift] + [p] then type c/c++ and click on the ui option, then select g++ as your default compiler?
programs/c++/games/sfml/tutorial/setup is just the path to a folder I had created. You can set this up in any directory you want. "cd" means change directory and "mkdir" means make directory. If that is confusing, you can open up a directory in vscode and follow along with that directory
Hi all, The audio of this is pretty messed up. I released a video for setting SFML up in directory (which I prefer to what is shown here) that has much better audio and editing.
Hi, could you help me with this? When I use command " g++ main.o -o main -lsfml-graphics -lsfml-window -lsfml-system" I get an error "collect2.exe: error: ld returned 1 exit status" and the message says "cannot find -lsfml-window", "cannot find -lsfml-graphics", " cannot find -lsfml-system"
@@zuzannadomagaa3649 I am sorry, I totally spaced the linking line is what created the executable. You can manually set up the linker path by adding -LyourLibPath so an example would be: g++ main.o -o main -LC:/SFML/lib -lsfml-graphics -lsfml-window -lsfml-system //one note is that I haven't tested using C:/ as I normally put the lib folder in the project directory so it usually looks like -Lsrc/lib
I have a problem my terminal stil gos to this error do you knou haw to fix this? c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lsfml-systemst collect2.exe: error: ld returned 1 exit status and comand make dosnt work as well bot this is no problem or no big problem :D
I believe the linker cannot find the lib file (sfml-systemst.a) in the the lib folders of MinGW. Did you mean to type -lsfml-system not -lsfml-systemst?
@@herbglitch thank you for the quick reply i tright but it show this error c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16'
@@herbglitchi did all from your tutorial and a command i used is g++ main.o -o main -lsfml-graphics -lsfml-window -lsfml-system and this one g++ main.o -o main -lsfml-graphics -lsfml-window -lsfml-systemst bouth of tham showes error. First one this eroro c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16' and second one this one c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lsfml-systemst
I normally cd into a folder, then compile each directory to the folder and link from the main folder using the compiled folder. I will link an example below
@@maazsiddiqui6324 Can you give me the full output of the error? also, I might be a bit slow to respond as my schooling is swamping my time, but I will try and help you figure it out
@@maazsiddiqui6324 I am not sure how you are compiling it, can you try: "g++ -c *.cpp", then: "g++ *.o -o main -lsfml-graphics -lsfml-window -lsfml-system" in your cmd or terminal
Some things that might be causing the error: The environment variable path to MinGW might have gotten messed up. The include files might be missing from MinGW's folder. The lib files might be missing. Please check each of these folders to see if they are the problems. I recently found out that if you put the include and lib folders in your project, you can manually link them in your makefile. I like this method more because you can push everything needed to compile to github. Here is how I normally do it: //file tree example Project Dir dependencies include SFML all sfml include files lib all sfml lib files project folder and all project code Makefile then in the Makefile you can link like: g++ src/compiled/*.o -o main -Isrc/include -Lsrc/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio Idk if that makes sense. I can make another tutorial with this linking method if yall would like me to
Hey, When I try to run the line that creates the "main.exe" file, I get an error saying "undefined reference to `WinMain@16'". If you could tell me why this happening that would be great.
@@herbglitch I finally got it working it was missing the dll in MINGW bin folder. but it makes my game crash for whatever reason..... it works perfectly in visual studio I think it has to do with my states but idk d
Highlighted reply HerbGlitch 11 hours ago programs/c++/games/sfml/tutorial/setup is just the path to a folder I had created. You can set this up in any directory you want. "cd" means change directory and "mkdir" means make directory. If that is confusing, you can open up a directory in vscode and follow along with that directory
Can you paste the makefile? Normally that means that there is no command in the makefile for what you are trying to do. if you type "make" in the cmd, make will look for the command "all:". if you type "compile" make will look for "compile:" I hope that makes sense
@@herbglitch all: compile link test: compile link run compile: g++ -c *.cpp link: g++ *.o -o main -lsfml-graphics -lsfml-window -lsfml-system clean: del *.o run: main.exe
@@davisantosmartinsbarroso1127 Oh, that looks right. Are you pathed in the directory that holds the makefile when trying to run it? @Rahat Siddique No worries about being a noob putting effort to learn is always awesome :)
I am sorry m'dude. I made this with my headset mic. All other videos on this channel have been recorded with a new mic I bought. I made a new video recently on setting up SFML in directory (which I think is a slightly better way) if you want to check that out. The audio should be a lot louder.
@@herbglitch oooo dont worry i subbed, but since i never watch the date of a video i comment anyways about the flaw if it has any on audio or black screen, ill check that later, no need to apologize, maybe just put a comment on the video so people like me knows that issue has been solved.
Sorry I didn't respond sooner. TH-cam didn't notify me of any new messages. Here is the server link: discord.gg/eqz5jHSUy4 and my username is herbglitch#0024
At 5:29, I was just going into my directory where I would be coding. As for the error, I am not sure why you get an opengl not in sync error. I would suggest googling the error message, and if that does not work, I would check the include folder to see if you have a "GL" folder
This was the only tutorial that worked for me, I've been trying it for a week. Thanks bro.
Thank you :)
Heck yeah man you saved my life. I was so frustrated because all those other tutorials just didn't work but yours is perfect in any way. Immediatly subscribed!
I am glad to hear you enjoyed it :) thank you for subscribing
the best strightforward guide i found in hours! really so underrated, subbed.
You did a great job explaining and i hope you continue making tutorials. Besides getting SFML setup ilearned about Makefiles and it ACTUALLY worked which was not the case in the other videos.
(please excuse spelling/grammar mistakes im german :) )
Thank you :). I plan on doing a series about creating a 2d game engine with SFML soon. I just need to get on top of my college classes first.
Thank you so much! Helped me set this up and understand Makefiles too, really appreciate it dude!
I am glad this video was able to help you :)
Thank a lot man. I have a coursework in this semester, your video helped me
I am glad to hear it helped :)
this is the only tutorial that work on youtube
Thank you :)
Hi all, sorry for being away for some time, I am planning on creating and releasing the first of the game engine video soon. I recorded the video a couple times but was unsatisfied by how it would turn out and how long the videos were, so I am going to write a script in order to cut down the video time and include challenges. I will try to create and release the video soon.
Thank you for such great tutorial! It was really helpful!
no problem, I am glad I this helped
Thank you so much , you have helped me start my project work!
Np. I am glad to hear that it worked for you :)
Bro this is great and did a great job ...hoping to see more...really helped a lot cheers
Thank you :). I am planning on making a series where we build a game engine (and to test it out, some games). I recorded the next video, but it was 50 minutes long and I want to make them around 15 min each. My plan is to create a main video where we build the game engine, and short sub videos (like 5 min each) explaining the different topics. It might be a couple of weeks till the next video though because I need to get on top of my college classes :)
@@herbglitch All the very best man ✌️
is finally working!
Heck Yeah!
Appreciate it, very in depth and clear
Thank you
thank you very much friend, very much helped)😁
sooo underated man... Thank you for this, tho the volume is low
Thank you! for all future videos, I will try to make sure the volume is not low (I bought a mic to try to fix that).
Very good explanation
Thank you
Thank you that's only one that worked
I am glad to hear it worked :)
thanks bro, it works !
No problem :) I am glad to hear it is working
thanks It Worked
I am glad to hear it worked :)
love you, bro... :)
Edit:
We can also do one thing more instead of putting the "bin/*.*" files in the current project folder we can add that bin directory to the environment variable too. or just put these files in the MinGW bin folder...
Now we don't have to create a mesh every time we create a new project folder...
That makes a ton of sense! thank you :)
I follow your tutorial step by step. When I write main.exe it doesn't show any window.
Thanks, dude It's Working.......
No problem, I am glad to hear it is working :)
so understandable
Thank you
thanks man
np :)
why i get error : the procedure entry point __gxx_personality_seh0 could not be located in the dynamic link library .....\sfmlProject\sfml-graphics-2.dll? can anyone help me, i have very hard to solve this error
thank you it works!!
No problem. I am glad to hear it works!
its not works :(
thanks! you got my sub! :)
Thank you
Your video is an excellent guide. I just hope the volume could be higher though.
Thank you. Idk what happened with the audio, but I bought a new mic to hopefully fix that problem for future videos.
It works and compile BUT i'm having red squiggle underneath the #include I think it was the c++ intellisense any suggestion?
I would try [ctrl] + [shift] + [p] then type c/c++ and click on the ui option if there is one, then set the compiler to g++ from where you have it installed. If that doesn't work, please let me know
@MarbleXeno I am glad to hear it worked :)
@@herbglitch Thanks, It works for me too.
@HerbGlitch it works thank you but mind if I ask, do we need to always do this process everytime we make a SFML project?
@@hizonopusdie I believe there is a way to set it as the default within your vs code main settings. You go to vs code main setting page, then click on the c++/c section and I think it will give you the option to set a default compiler path. I think that should fix it permanently, though I am not sure. I recently learned a way to include all the files needed for sfml within the project directory and because it is in the workspace folder intellisence usually picks up on it. I set it up in the new way on the game engine series I am working on.
Я тебя люблю ❤️
Hello, great tutorial but I ran into one problem, when I try and create the main.exe file I keep getting the same message that says:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0\libsfml-system.a when searching for -lsfml-system
This line repeats a couple times and then it gives me the following line:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lsfml-system
I have the same issue for -lsfml-window and -lsfml-graphics as well. I saw you respond to someone having the same issue as me so I tried using the -L{where the lib is} line that you said to do and I got the same issue. Any help would be greatly appreciated!
The first line is the command I used initially and the second line is the line I also tried but still got nothing:
g++ *.o -o main -lsfml-graphics -lsfml-window -lsfml-system
g++ main.o -o main -LC:\SFML-2.5.1-windows-gcc-7.3.0-mingw-32-bit\SFML-2.5.1\lib -lsfml-graphics -lsfml-window -lsfml-system
Sorry for the late response, youtube has stopped notifying me when people comment. This could be due to a different name of the .a differs from sfml-system, or it could be dlls are needed in the same dir as your exe. If you have discord and want to debug, you can dm me at HerbGlitch#5572 and I am down to help debug
Great tutorial! Is there going to be a follow up to this one? Btw try making the sound louder in whatever video editor you use I can't really hear you unless I go to 100% volume
Thank you. I really want to create a new video about building a game or game engine. I am trying to figure out how best to teach the topics. Idk at what level I would be best at teaching or what concepts would be best to go through. I bought a new mic for next time I record to hopefully fix the volume. One disclaimer is most of my attention and time are focused on college and pocketcampaigns.org. If anyone has any suggestions for what they would like to learn, please let me know. I try to check this comment section often :)
When I pasted the test code in vs code, it's showing a red line (error) at #include . In the problems tab it says "#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit "(and then my project folder where my main.cpp exists). And it shows another error that says "cannot open source file "SFML/Graphics.hpp"". I've tried to setup sfml for 2 weeks now and I don't know what to do. Any help really appreciated! :)
Sorry for not responding sooner. I have been moving all day. Can you check in settings if you have mingw as your default Compiler with the correct path? I have posted a 3-4 min video for in project setup and it guides through vs codes settings for mingw
@@herbglitch thanks for your reply, I wrote "C:/MinGW/bin/g++.exe on the compilerPath and "${workspaveFolder}/**" on the includePath, but when I go back to my main.cpp it still shows an error at the include line like before. Thanks again for your reply! :)
@@mikael808 Hmm.. Do you have the sfml folders in the project directory? or, do you have a project .vscode file that is pathing incorrectly?
If you want to debug and fix this sometime, I can live share or talk over discord or smthn. Just let me know :)
@mope.io That is good to hear :)
hello i´ve got a problem. when i copy paste the main cpp code from the sfml page. visual code show this two errors
#Include errors have been detected. Update the value of includePath. Wavy underline is disabled for this translation unit (C: \ sfml project \ main.cpp)
cannot open source file (error code "SFML / Graphics.hpp").
sorry for my primitive english
I think the error is caused by vscode's settings. Just to check, can you compile and run the program?
Hey so I've been trying to do this in atom, and I'm not having any success. I'm getting this error:
"main.cpp:1:10: fatal error: SFML/Graphics.hpp: No such file or directory
#include
^~~~~~~~~~~~~~~~~~~
compilation terminated."
If you need more info reply and tell me what it is, I have the dll files in. The command I ran was:
"g++ -c main.cpp"
I also tried:
"g++ main.cpp -lsfml-graphics -lsfml-window -lsfml-system"
would you be chill to try setting up sfml in your project? I am have kindof forgotten how to debug for the way we set this up in the video
@@herbglitch I eventually was able to solve it on my own, don't ask me how. I have no idea.
@@hex697 no worries, I am glad to hear you got it solved :)
I followed this exactly but I see errors when I paste the code in vscode, basically that it doesn't recognize things like shape etc
can you try to update which compiler intellisense is using for vscode? [ctrl] + [shift] + [p] then type c/c++ and click on the ui option, then select g++ as your default compiler?
it's not working
What part is not working?
Whenever i type "make" it say "make: *** No targets specified and no makefile found. Stop." Why?
Are you in the directory with your makefile when you run the command? (if you type dir you can see if it has the file or not)
when i wrote : cd "programs\c++\games\sfml\tutorial\setup" on my command prompt, it said the system cannot find the path specefied. what should i do??
programs/c++/games/sfml/tutorial/setup is just the path to a folder I had created. You can set this up in any directory you want. "cd" means change directory and "mkdir" means make directory. If that is confusing, you can open up a directory in vscode and follow along with that directory
I am getting a really big error about 10-12 lines saying:
Undefined reference to... a lot of things
I followed the tutorial and did everything
Are you using mingw-w64? If so, you may want to use the mingw installer instead. I have had problems like that with mingw-w64.
@@herbglitch I'm using Mingw 32-bit on my win 10 pc, vscode
Can you please send the errors?
Here it is, really big and bad boi, something you can suggest?
I personally think it could be that the installer version of mingw is the only one that works with the pre compiled binaries of sfml
What do I do if I'm missing the c++ folder at 4:35
You may want to re-install MinGW with the installation manager. If that doesn't work let me know and I can help debug.
Hi all, The audio of this is pretty messed up. I released a video for setting SFML up in directory (which I prefer to what is shown here) that has much better audio and editing.
Hi, could you help me with this? When I use command "
g++ main.o -o main -lsfml-graphics -lsfml-window -lsfml-system" I get an error "collect2.exe: error: ld returned 1 exit status" and the message says "cannot find -lsfml-window", "cannot find -lsfml-graphics", " cannot find -lsfml-system"
Do you have the .dll files that are found in sfml/bin copied into the same directory as your .exe?
@@herbglitch I don't have any .exe, only main.cpp, main.o and .dll files. When I used "g++ -c *.cpp" it only created main.o
@@zuzannadomagaa3649 I am sorry, I totally spaced the linking line is what created the executable. You can manually set up the linker path by adding -LyourLibPath
so an example would be:
g++ main.o -o main -LC:/SFML/lib -lsfml-graphics -lsfml-window -lsfml-system
//one note is that I haven't tested using C:/ as I normally put the lib folder in the project directory so it usually looks like -Lsrc/lib
I have a problem my terminal stil gos to this error do you knou haw to fix this? c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lsfml-systemst
collect2.exe: error: ld returned 1 exit status and comand make dosnt work as well bot this is no problem or no big problem :D
I believe the linker cannot find the lib file (sfml-systemst.a) in the the lib folders of MinGW. Did you mean to type -lsfml-system not -lsfml-systemst?
@@herbglitch thank you for the quick reply i tright but it show this error c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16'
Did you compile a main function as well? If so, did you link all the .o files?
@@herbglitchi did all from your tutorial and a command i used is g++ main.o -o main -lsfml-graphics -lsfml-window -lsfml-system and this one g++ main.o -o main -lsfml-graphics -lsfml-window -lsfml-systemst bouth of tham showes error. First one this eroro c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16'
and second one this one c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lsfml-systemst
@@herbglitch I started playing for couple of minutes and it start working. Thank you for your quick response and create videos like this.
Hello how should I modify my makefile for it to compile all files even in the subfolder? (You can tell me if my comment is not understandable)
I normally cd into a folder, then compile each directory to the folder and link from the main folder using the compiled folder. I will link an example below
Example: github.com/HerbGlitch/testing-platformer/blob/master/Makefile
@@herbglitch I don't understand and how can I adapt it for my project :,/
@@herbglitch Oooh I get it it works thank you!
@@sothis6488 I am glad to hear it works :)
how to complite the code bro please i cant understand what you did and that code compiled with new make file
also my error is collect.exe related please help
@@maazsiddiqui6324 Can you give me the full output of the error? also, I might be a bit slow to respond as my schooling is swamping my time, but I will try and help you figure it out
@@herbglitch 1) i wrote the code and dont know hot to execute it.
2) when i tried some extension it compiled but gave error of collect.exe related
@@maazsiddiqui6324 I am not sure how you are compiling it, can you try: "g++ -c *.cpp", then: "g++ *.o -o main -lsfml-graphics -lsfml-window -lsfml-system" in your cmd or terminal
@@herbglitch never mind bro i am demotivated now. I wanted to learn sfml and cpp graphics but nvm. Your video was great tbh it helped me. Thanks
cannot open source file "SFML/Graphics.hpp"
During which step?
me too. The error happened after the Makefile and gnuwin32.
@@purpurax8194 same problem
Some things that might be causing the error:
The environment variable path to MinGW might have gotten messed up.
The include files might be missing from MinGW's folder.
The lib files might be missing.
Please check each of these folders to see if they are the problems.
I recently found out that if you put the include and lib folders in your project, you can manually link them in your makefile. I like this method more because you can push everything needed to compile to github.
Here is how I normally do it:
//file tree example
Project Dir
dependencies
include
SFML
all sfml include files
lib
all sfml lib files
project folder and all project code
Makefile
then in the Makefile you can link like: g++ src/compiled/*.o -o main -Isrc/include -Lsrc/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
Idk if that makes sense. I can make another tutorial with this linking method if yall would like me to
Hey, When I try to run the line that creates the "main.exe" file, I get an error saying "undefined reference to `WinMain@16'". If you could tell me why this happening that would be great.
can you send me the line you used to compile your code to "main.exe"?
@@herbglitch g++ main.o -o main -lsfml-graphics -lsfml-window -lsfml-system
I cannot really help debug unless I see your code. The problem most likely resides in your main function
@@herbglitch I finally got it working it was missing the dll in MINGW bin folder. but it makes my game crash for whatever reason..... it works perfectly in visual studio I think it has to do with my states but idk d
@@herbglitch thank you
Howdy
"make: *** No targets specified and no makefile found. Stop." ??
Highlighted reply
HerbGlitch
11 hours ago
programs/c++/games/sfml/tutorial/setup is just the path to a folder I had created. You can set this up in any directory you want. "cd" means change directory and "mkdir" means make directory. If that is confusing, you can open up a directory in vscode and follow along with that directory
Can you paste the makefile?
Normally that means that there is no command in the makefile for what you are trying to do.
if you type "make" in the cmd, make will look for the command "all:". if you type "compile" make will look for "compile:" I hope that makes sense
@@herbglitch i don't know bro. i'm still a noob at it.
@@herbglitch
all: compile link
test: compile link run
compile:
g++ -c *.cpp
link:
g++ *.o -o main -lsfml-graphics -lsfml-window -lsfml-system
clean:
del *.o
run:
main.exe
@@davisantosmartinsbarroso1127 Oh, that looks right. Are you pathed in the directory that holds the makefile when trying to run it? @Rahat Siddique No worries about being a noob putting effort to learn is always awesome :)
cant hear shit, ma dude, and im at 100% on headphones, had to download and vlc the shit out of your video, to hear it
I am sorry m'dude. I made this with my headset mic. All other videos on this channel have been recorded with a new mic I bought. I made a new video recently on setting up SFML in directory (which I think is a slightly better way) if you want to check that out. The audio should be a lot louder.
@@herbglitch oooo dont worry i subbed, but since i never watch the date of a video i comment anyways about the flaw if it has any on audio or black screen, ill check that later, no need to apologize, maybe just put a comment on the video so people like me knows that issue has been solved.
Chill beans, I am off to bed now, but in the morning I will try to remember to post a comment :)
What is your discord???
Sorry I didn't respond sooner. TH-cam didn't notify me of any new messages. Here is the server link: discord.gg/eqz5jHSUy4 and my username is herbglitch#0024
5:29 i did not understand this part
Edit : when i compiled and run ,it works but it shows opengl not in sync error
At 5:29, I was just going into my directory where I would be coding. As for the error, I am not sure why you get an opengl not in sync error. I would suggest googling the error message, and if that does not work, I would check the include folder to see if you have a "GL" folder