Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Getting started with Code Blocks on Windows  (Read 5846 times)

0 Members and 1 Guest are viewing this topic.

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Getting started with Code Blocks on Windows
« on: March 05, 2013, 12:22:28 am »
I'm trying to get set up with SFML in Code Blocks on Windows 7. I'm currently following the official tutorial but running into some problems.

Following the guide, I have my linker settings as below:
Image
However, as you can see, when I build my project, I get errors of the type: "cannot find -lsfml-graphics-s-d".

However, if I select the .a files from the file browser using the Add library button, my settings look like this:
Image
Note the different set of errors.

I have my search directory set up correctly:
Image
And that is directory where I unpacked the library.

So... what am I doing wrong?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Getting started with Code Blocks on Windows
« Reply #1 on: March 05, 2013, 12:33:41 am »
I'm not sure if that will solve the problem, but you shouldn't work in the Program Files directory, since it kinda requires admin rights to change stuff in there and maybe code::blocks doesn't get the rights to 'search' the directory for SFML and just errors our with 'not found'.
I usually work with a second partition, that holds all my data files and got for some additional development tools a directory C:\Dev\ but anythings outside of Program Files should work fine. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Getting started with Code Blocks on Windows
« Reply #2 on: March 05, 2013, 12:43:37 am »
I moved SFML out of Program Files (now in C:\Dev\), and I'm still getting the same errors.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Getting started with Code Blocks on Windows
« Reply #3 on: March 05, 2013, 12:52:32 am »
Try setting the search path in the project settings, rather than the Debug mode settings.
Also does it work if you specify libsfml-graphics-s-d or libsfml-graphics-s-d.a?

I assume you're using the MinGW version that came with Code:Blocks 12.11, right?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Getting started with Code Blocks on Windows
« Reply #4 on: March 05, 2013, 12:57:46 am »
The search path is set in all three (SFML Test, Debug, and Release).
Both libsfml-graphics-s-d and libsfml-graphics-s-d.a produce the same error as sfml-graphics-s-d.

And yes, CB 12.11 with MinGW g++ compiler.

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Getting started with Code Blocks on Windows
« Reply #5 on: March 05, 2013, 01:01:28 am »
Actually no, I got the compiler from here. I got the 1/13/2013 weekly snapshot for gcc 4.8 and 64-bit Windows.

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Getting started with Code Blocks on Windows
« Reply #6 on: March 05, 2013, 04:32:56 am »
Update: So I downloaded and set up MinGW in CodeBlocks, and now I'm looking at a different set of errors:


Any ideas?

io

  • Jr. Member
  • **
  • Posts: 52
  • z/OS by day, SFML by night
    • View Profile
Re: Getting started with Code Blocks on Windows
« Reply #7 on: March 05, 2013, 06:46:46 am »
These are my settings for codeblocks:

http://en.sfml-dev.org/forums/index.php?topic=10366.msg71355#msg71355

It may have to do with your mingw not synching up w/ your SFML build -- match up your install to exploiters nightly builds.  I think if you grab mingw/code blocks pair off of the codeblocks main site it installs gcc 4.7.1 tdm

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Re: Getting started with Code Blocks on Windows
« Reply #8 on: March 05, 2013, 07:50:03 am »
Actually no, I got the compiler from here. I got the 1/13/2013 weekly snapshot for gcc 4.8 and 64-bit Windows.
GCC 4.8 is still in development and thus undstable. I'd strongly advise against the useage of unstable compilers.

Any ideas?
Your compiler isn't compatible with your SFML  version. You need to rebuild SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: AW: Re: Getting started with Code Blocks on Windows
« Reply #9 on: March 05, 2013, 03:55:34 pm »
Actually no, I got the compiler from here. I got the 1/13/2013 weekly snapshot for gcc 4.8 and 64-bit Windows.
GCC 4.8 is still in development and thus undstable. I'd strongly advise against the useage of unstable compilers.

Any ideas?
Your compiler isn't compatible with your SFML  version. You need to rebuild SFML.
I believe you missed the part where I downloaded the latest version of MinGW and set that up in Code Blocks instead of the 4.8 compiler. The image above shows the errors I'm getting.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Getting started with Code Blocks on Windows
« Reply #10 on: March 05, 2013, 04:01:38 pm »
My second comment quoted your last message. ;)

The errors mean, that your compiler isn't compatible with your SFML version, you need to rebuild SFML.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Getting started with Code Blocks on Windows
« Reply #11 on: March 05, 2013, 04:03:16 pm »
Whoops, sorry. Just woke up and the brain's not quite clicking yet. Thanks for your help!

the_composer

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Getting started with Code Blocks on Windows
« Reply #12 on: March 07, 2013, 07:04:10 am »
So I followed the guide here, but when building I get the error: gcc\bin\ar.exe: *.o: Invalid argument

Image

ar.exe is set as the Linker for static libs in the toolchain executables. What's wrong here, and how can I fix it?
« Last Edit: March 07, 2013, 06:30:34 pm by the_composer »

 

anything