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

Author Topic: Code Blocks cant find Libraries  (Read 3021 times)

0 Members and 1 Guest are viewing this topic.

Chay Hawk

  • Full Member
  • ***
  • Posts: 101
    • View Profile
    • Email
Code Blocks cant find Libraries
« on: August 13, 2014, 09:01:31 am »
I don't understand what's going on here, I have Code Blocks 13.12 with MinGW, I downloaded the "GCC 4.7 TDM (SJLJ) - 64 bits" version of SFML and I followed the tutorial, here:

http://www.sfml-dev.org/tutorials/2.1/start-cb.php

exactly as it was shown and I get 3 errors. Here it what it says:

||=== Build: Debug in SFML Test (compiler: GNU GCC Compiler) ===|
\SFML-2.1\lib\libsfml-graphics||No such file or directory|
\SFML-2.1\lib\libsfml-window||No such file or directory|
\SFML-2.1\lib\libsfml-system||No such file or directory|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


What is wrong? I have Windows 8 64 bit.


Also here is this from the build log:

-------------- Build: Debug in SFML Test (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\SFML-2.1\lib -o "bin\Debug\SFML Test.exe" obj\Debug\main.o   C:\SFML-2.1\lib\libsfml-graphics C:\SFML-2.1\lib\libsfml-window C:\SFML-2.1\lib\libsfml-system
mingw32-g++.exe: error: C:\SFML-2.1\lib\libsfml-graphics: No such file or directory
mingw32-g++.exe: error: C:\SFML-2.1\lib\libsfml-window: No such file or directory
mingw32-g++.exe: error: C:\SFML-2.1\lib\libsfml-system: No such file or directory
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))


It says mingw32, do i need to download the 32 bit version of SFML?
« Last Edit: August 13, 2014, 09:04:54 am by Chay Hawk »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Code Blocks cant find Libraries
« Reply #1 on: August 13, 2014, 09:16:25 am »
Quote
C:\SFML-2.1\lib\libsfml-graphics C:\SFML-2.1\lib\libsfml-window C:\SFML-2.1\lib\libsfml-system
This is not correct, please read the tutorial again and have a look at the screenshots. Do the same in your project.
Laurent Gomila - SFML developer

Chay Hawk

  • Full Member
  • ***
  • Posts: 101
    • View Profile
    • Email
Re: Code Blocks cant find Libraries
« Reply #2 on: August 13, 2014, 09:54:36 am »
Ok I forgot to take out lib in front of sfml, however I did that and I still get errors:

||=== Build: Debug in SFML Test (compiler: GNU GCC Compiler) ===|
\SFML-2.1\lib\sfml-graphics||No such file or directory|
\SFML-2.1\lib\sfml-window||No such file or directory|
\SFML-2.1\lib\sfml-system||No such file or directory|
||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


If I do JUST

sfml-graphics etc.

I get these errors:

||=== Build: Debug in SFML Test (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|5|undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|5|undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|6|undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|7|undefined reference to `_imp___ZN2sf5Color5GreenE'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|7|undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|15|undefined reference to `_imp___ZN2sf6Window5closeEv'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|12|undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|18|undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|18|undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|20|undefined reference to `_imp___ZN2sf6Window7displayEv'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|9|undefined reference to `_imp___ZNK2sf6Window6isOpenEv'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
C:\Users\thund_000\Desktop\SFML Test\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
obj\Debug\main.o||In function `ZN2sf11CircleShapeD1Ev':|
C:\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
C:\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
C:\SFML-2.1\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZN2sf5ShapeD2Ev'|
||=== Build failed: 20 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
« Last Edit: August 13, 2014, 09:56:31 am by Chay Hawk »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Code Blocks cant find Libraries
« Reply #3 on: August 13, 2014, 09:59:19 am »
Can you post the content of your project file (.cbp)?
Laurent Gomila - SFML developer

Chay Hawk

  • Full Member
  • ***
  • Posts: 101
    • View Profile
    • Email
Re: Code Blocks cant find Libraries
« Reply #4 on: August 13, 2014, 10:00:58 am »
Yeah, it's the test code when you follow the instructions to set it up:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Code Blocks cant find Libraries
« Reply #5 on: August 13, 2014, 10:02:17 am »
I didn't ask for your code, but for your Code::Blocks project file, the .cbp one.
Laurent Gomila - SFML developer

Chay Hawk

  • Full Member
  • ***
  • Posts: 101
    • View Profile
    • Email
Re: Code Blocks cant find Libraries
« Reply #6 on: August 13, 2014, 10:04:31 am »
Oh ok.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Code Blocks cant find Libraries
« Reply #7 on: August 13, 2014, 10:28:15 am »
You're still doing it wrong. I don't know what else to say, look at the tutorial, it's not the same as what you did...
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
AW: Code Blocks cant find Libraries
« Reply #8 on: August 13, 2014, 02:02:36 pm »
Once you actually get it correct I certain it still won't work, because you're using incompatible libraries, unless you have installed the TDM 4.7 x64 compiler on your own.
At best, compile SFML with your current compiler.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/