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

Pages: [1]
1
General / Re: SFML Debug dll's + Release dll's
« on: November 24, 2020, 09:28:06 pm »
OOooooohhh my GOOd

Holy shit this makes so much sense.
Thank you so much. I think I might try to make a Conan recipe for Thor so I can integrate it the same way as everything else into my project.

So I'm guessing if I were to make it rely on the debug dlls, I just build it with the build type "Debug" via cmake right?

Anyways thanks again.

2
General / Re: SFML Debug dll's + Release dll's
« on: November 24, 2020, 07:21:02 pm »
Maybe we need to start from the beginning again and clarify what "it complains that it can't find the normal Release DLL's" means exactly.

When I have the debug dll's next to my executable like so:



it complains that it's missing the release libs: (Except for the networking release dll apparently it doesn't care about it)





Now at this point, I thought maybe the executable doesn't even need the debug dll's? So, I removed them. But then it complained, in the same way, that I was missing all of the debug dll's. So it looks like it does need the all debug dll's and for some reason just those three release dll's. Is this normal behaviour for my executable to need the three release dll's AND the debug dll's?

*.a files are import libraries, that tell the linker where to find the symbols in the provided DLL, but the extension is also used for static libraries, so this can be confusing at times.

Holy crap thank you so much for this it explains so much

3
General / Re: SFML Debug dll's + Release dll's
« on: November 24, 2020, 01:27:03 am »
I've been setting it via -DCMAKE_BUILD_TYPE=Debug and then in my CMakeFiles.txt, it uses the appropriate Conan profile of mine which tells Conan my build type.

It seems to be linking

C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-graphics-d.a
C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-window-d.a C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-network-d.a C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-main-d.a
C:/Users/Jody/.conan/data/sfml/2.5.1/....../lib/libsfml-system-d.a


I've also used Dependency Walker to check if the executable even relies on it, but the release SFML dlls aren't mentioned anywhere. Only the Debug dlls.
Also, I'm not quite sure how to make MinGW link to the dll's via CMake, as seen above it appears to be linking to the '.a' libs. Maybe that's part of the problem? My understanding of .dll's and .a files isn't too good.

4
General / SFML Debug dll's + Release dll's
« on: November 22, 2020, 04:13:40 am »
I'm using CLion + MinGW + Conan to build my application.

I'm using the shared libraries of SFML.
When I build in Debug mode, when I place my Debug DLL's ('-d ones') alongside my executable, it complains that it can't find the normal Release DLL's. Almost as if the Debug DLL's rely on the Release ones.

Is this normal behaviour? Am I meant to have to put the Release DLL's AND the Debug DLL's alongside my executable? If not, I likely have something wrong going on with my Conan setup.

5
General / Re: SFML and Box2d
« on: November 21, 2020, 11:46:57 pm »
Not sure if you've fixed this yet but here's a solution:

When you do "&Box()" you are returning a pointer to a stack-allocated object of type Box. This stack-allocated object gets destroyed when the scope ends. So basically, the Box() instance you create in the if statement will no longer exist by the end of the if block.

What you should do is use the "new" keyword as that will create the Box() instance on the heap and return a pointer to it. This will only be destroyed when you tell it to.

Your program crashes because your Box() instance gets destroyed pretty much straight away. The pointer that you add to the vector, now points to the destroyed object. So, by the time you access the object the pointer is pointing to in your drawing loop, it has been destroyed. This makes your program crash.

When creating objects using "new", you must make sure you call "delete" to delete your Box() instance as to prevent memory leaks and such. I recommend googling about c++ pointers and such to learn more about it.

Pages: [1]
anything