Larry
Larry

Reputation: 239

SFML and running from Code::Blocks

UPDATE: All Issues Resolved Using Bart's suggestions for Issue 2 & 3 ( first response )

Issue 1

For my game, I was using SDL, and everything was mostly okay. But I decided by recommendation of a friend to switch to SFML. I finally got all the changes done, and now when I try to build and run in Code::Blocks, the console opens up and then I get the following issue.

The program can't start because libgcc_s_dw2-1.dll is missing from you computer. Try reinstalling the program to fix this problem.

Issue 2

Well, when I originally tried running the exe created in the bin/debug folder, I got a message saying

sfml-graphics.dll cannot be found.

Well, when I copy and paste the SFML DLLs in the bin/debug folder everything works fine. But note, only when running the application from the windows explorer ( running from Code::Blocks still shows the mentioned issue ).

Issue 3:

When I try to build and run in the Release build target, I get a compiler error mentioning a undefined reference. NOTE, I didn't get this error when using the Debug build target.

Can anyone point me in the direction of a solution.

Upvotes: 0

Views: 799

Answers (1)

Bart
Bart

Reputation: 20028

Normally you should give us a bit more info to work with, but let's have a go

For issue 1:
It can't find the DLL. Either make sure it's visible by including it in the same directory as your executable, or by having the path to the file as part of your PATH environment variable.

For issue 2:
Make sure that Code::Blocks does not have another directory set as the working directory for your executable. I'm not sure about C::B, but in Visual Studio you can explicitly set this.

For issue 3:
Going off the information you give us, I would say that you forget to link against a certain library (the particular undefined reference should give you a hint as to which one it is) in release mode, that you do correctly link against in debug.

Upvotes: 1

Related Questions