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

Pages: [1]
1
General / Re: General Linker Questions
« on: April 25, 2020, 07:16:31 pm »
Thank you so much!  ;D

One more question I had is if sfml-main needs to be linked for any reason, either statically or dynamically?  I read in some tutorials online that you need to, but they might have been for an older version of SFML.

Additionally, in Code::Blocks it's super handy to map sfml\bin under the global compiler settings -> toolchain executables -> Additional paths, so when your testing a dynamic SFML project it doesn't need the .dll files in the \bin\debug folder of your project.  Is there a place under the project build settings where you can map sfml\bin when your working on a dynamically linked project so it doesn't need to be mapped under the global compiler settings?

It works if you map it under search directories -> linker along with sfml\lib but I feel like that isn't the proper place for this...

Thanks again for the clarification!!!  :)

2
General / General Linker Questions
« on: April 23, 2020, 06:09:34 pm »
Hello!  I am really excited to be getting into C++ and so far SFML has made this so much more enjoyable.  I have a few general questions WRT linking that I could not find in the FAQs or on google that should be pretty simple.

I am running on Code::Blocks 20.03 on Windows 10 with MinGW 7.3.0 x64 (SEH)
SFML v2.5.1 as per the download page for CGG 7.3.0 MinGW (SEH) x64

I have had a little confusion about the linker settings because sometimes a project will compile and run just dandy, but if I create another project with identical project/build settings and even use the same code from the previous project in CB, it will throw compile errors.

1.  Is it common for Code Blocks not to run/execute the project/build settings if they were recently changed?  I feel like I have gone into that setting screen and configured it every possible way but it will throw the same error, regardless of what is linked or changed when I try to rebuild the project.
I figured out you have to rebuild the whole project for the linking settings to actually work.

2.  Is it okay to link to the dynamic libraries for the debug build, and the static libraries for the release build?  I was reading in another thread that you shouldn't link to both the dynamic and static libraries at the same time, but if they are configured to be completely separate for the debug and release build settings that shouldn't be an issue, correct?

For example, should the following settings work or do I need to link the the sfml-xxx-s-d libraries for the debug portion of the settings?
 
Project 1 -> SFML App -> Search Directories -> Compiler -> SFML\Include
                                                                      -> Linker     -> SFML\Lib
Debug -> Linker Settings
               sfml-graphics-d
               sfml-window-d
               sfml-system-d
               sfml-main-d

Release -> Linker Settings
               sfml-graphics-s
               freetype
               sfml-window-s
               opengl32
               gdi32
               sfml-system-s
               winmm
               sfml-main
             -> Compiler Settings -> #Defines -> SFML_STATIC
                                               -> compiler Flags -> -static

3.  When static linking, I am a little confused about the order of the dependencies.  sfml-graphics depends on sfml-windows which depends on sfml-system so you list them top to bottom in that order.  But when static linking, both sfml-window and sfml-system both depend on winmm.  Does this mean you should order winmm at the very bottom like:

sfml-window-s
sfml-system-s
winmm

Is it more clean to just order all sfml files at the top and all the other dependencies at the bottom?

4.  The SFML and Code::Blocks tutorial and the FAQ "How do I link SFML statically?" lists the dependencies as... 
sfml-window, sfml-graphics, sfml-audio, sfml-network, sfml-system... with their sub-dependencies. 

These are not showing the main modules in their proper order, correct? They should be audio, graphics, window, network, system? 


Thank you very much for any help!  I know these probably seem pretty n00b :) but I hope they make sense. Just trying to fully understand how all these things plug together.

Pages: [1]
anything