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

Author Topic: Fresh Build - Problems Galore [Hahaha SOLVED XD]  (Read 2653 times)

0 Members and 1 Guest are viewing this topic.

Kain Nobel

  • Newbie
  • *
  • Posts: 38
    • View Profile
Fresh Build - Problems Galore [Hahaha SOLVED XD]
« on: February 02, 2022, 06:01:06 pm »
Hello and good day!

I was having CMake file problems so I decided to clear all my CMake files, then I decided to just clear the whole library and start over because another 8 hour night of heroic measures trying to build is uncalled for. (I'm experimenting with 3 different IDEs in the same project - it got ugly.)

I know, I know, I just set up a couple weeks ago, I'm setting up again already @_@

So...

The project can't find "AlCheck.hpp" and "AudioDevice.hpp" (and probably other libraries.)

I followed the SFML and Code::Blocks (MinGW). I followed Compiling SFML with CMake.

I've went to Build Options... > Search Directories > Compiler > and added "C:\SFML\2.5.1\extlibs\headers"
I've went to Build Options... > Search Directories > Linker > and added "C:\SFML\2.5.1\extlibs\headers"

Neither of these seem to be doing it.

I tried doing a lot of digging before I came here looking for help, I did pass by a mention of these problems on Apple (but the contributors were talking about Apple comes with OpenAL embedded so...) I'm not on Apple, or building from Apple, but I do wonder if the problem is semi-related? Hm. I'm trying to build on Windows.

Now I have to get to work, I'll try to get back to figuring this out in a day or so. Thank you to anybody who can help with some information on what I need to do, I'm not ready to quit yet :)
« Last Edit: February 04, 2022, 09:38:21 am by Kain Nobel »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Fresh Build - Can't Find OpenAL Files
« Reply #1 on: February 03, 2022, 08:57:38 am »
Your compile directory should point to C:\SFML\2.5.1\include and the Linker directory should point to C:\SFML\2.5.1\lib, no need to fiddle with the extlibs directory at all.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kain Nobel

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Fresh Build - Can't Find OpenAL Files
« Reply #2 on: February 04, 2022, 07:41:25 am »
After a long day's work, I'm back.

So I tried to do some things before I came here looking for more help. I tried another fresh build, this time using...

[GCC] 7.3.0 MinGW (DW2) - 32-bit

MinGW Builds 7.3.0 (32-bit)

The tutorial I followed EXACT (again).

Anyways, I get...



...I notice the 7.3.0 MinGW version of SFML 2.5.1 has no /src folder. OK. So I download fresh from Github (only the /src folder because I don't need more than that.) No prob. Right?

...Is there a reason there are .hpp files in /src? Some of the headers I need are from /src and this is from a fresh, brand new download. If the system isn't able to find these .hpp files then I'm taking the executive decision to move them to /include.

(click to show/hide)

...So now I'm moving those .hpp from /src to /include. I've moved ALL these files, it was a lot. I'm not sure if they're supposed to be in /src but my GUT tells me /include is the place to be.

So now I build again...



The Island example game wouldn't compile, so I downloaded stb_perlin.h and put it where it needs to be.

Now I'm back to...



Oh.

Is this something that is needed? I'm not familiar enough with the guts of SFML to know. I can only assume this is related to CSFML bindings, especially since that file extension is an .h and not a .hpp. For now I'm trying to build in purely C++, so I don't care for the CSFML portion (yet). Do I need to write something here to skip the check for these .h files? Are they needed for C++ SFML too? What would the preprocessor commands look like to skip this (if that's what I need to do)?

So, this^ comes full circle to the last time I tried to deploy and build fresh. Now that I've been through this process 3 times (yuck!), perhaps the tutorials ARE accurate but some things have changed in the library? I don't know...

EDIT: I've commented out the #include 'al.h' and #include 'alc.h' but that doesn't fix anything either.



So now I'm copying the extlibs into the SFML root directory.



^This pops up a whole bunch of times (in Code::Blocks).

It builds fresh regardless but I get (again)...



So... here are my settings.


EDIT: Updated picture due to bad cropping :X

Do I need to add extlibs too?

The only thing I haven't done (for which I've done last time) is build fresh with CMake. I'm not against building fresh with CMake but I want to make sure all my bases are covered before I touch it because I don't want it dumping on me a garbage truck full of files I don't need and can't use again. If I'm not using CSFML, then I probably don't need the extlibs right? (I might in the future but that's beyond the scope of this topic...) Is extlibs required to run OpenAL, OpenGL, etc or is that strictly for CSFML bindings?

I forget why I had to wipe SFML and start over, I just know one day I started getting a bunch of linker errors and... stuff. Which is strange because I wasn't messing with CMake, the Build options or anything, I was actually working on a Keyboard extension :( I'd like to see if that Keyboard extension works but I can't if the damn thing won't build! It WAS all building fine and it should've kept building fine because I hadn't changed any of the crucial pieces that make it work, nor have I touched the SFML source. :o

EDIT: So now I'm building with CMake. I've chose "Use default native compilers" and it gives...



OK. So I delete the files in /BUILD and I'm grabbing the CMakeLists.txt from Github.

Code: [Select]
The C compiler identification is GNU 5.1.0
The CXX compiler identification is GNU 5.1.0
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.22/Modules/CMakeRCInformation.cmake:27 (include):
  include could not find requested file:

    C:/SFML/2.5.1/cmake/CompilerOptionsOverride.cmake
Call Stack (most recent call first):
  C:/Program Files (x86)/CMake/share/cmake-3.22/Modules/Platform/Windows-GNU.cmake:130 (enable_language)
  C:/Program Files (x86)/CMake/share/cmake-3.22/Modules/Platform/Windows-GNU-C.cmake:2 (__windows_compiler_gnu)
  C:/Program Files (x86)/CMake/share/cmake-3.22/Modules/CMakeCInformation.cmake:48 (include)
  CMakeLists.txt:38 (project)


Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/TDM-GCC-32/bin/gcc.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: C:/TDM-GCC-32/bin/g++.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:43 (include):
  include could not find requested file:

    C:/SFML/2.5.1/cmake/Config.cmake


CMake Error at CMakeLists.txt:79 (sfml_set_option):
  sfml_set_option Macro invoked with incorrect arguments for macro named:
  sfml_set_option


CMake Error at src/SFML/CMakeLists.txt:3 (include):
  include could not find requested file:

    C:/SFML/2.5.1/cmake/Macros.cmake


CMake Error at src/SFML/System/CMakeLists.txt:64 (sfml_add_library):
  Unknown CMake command "sfml_add_library".


Configuring incomplete, errors occurred!
See also "C:/SFML/2.5.1/BUILD/CMakeFiles/CMakeOutput.log".

And now I'm going to Github to chase all this down^... (topic pending update...) Actually, I'm not going any farther than that. Is there a better way to do this???? I'm pretty livid at this point. Do I need to download the entire source tree and not bother with the stuff >>here, in the Downloads section<<? :|

I started at 5PM. It's 11PM now. I've carefully documented EVERY step.
« Last Edit: February 04, 2022, 08:35:34 am by Kain Nobel »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Fresh Build - Problems Galore
« Reply #3 on: February 04, 2022, 08:51:46 am »
Remember the advice I gave some weeks ago? Do one thing at a time and don't mix things. ;)

Anyways, I get...

That means, you've added some SFML source files to your project, which you shouldn't. Your project should only contain your own source code and none of the SFML one, thus you also don't need the SFML src/ directory.
These are SFML internal headers and the only way they can show up when you try to compile your application is if you've added SFML source code to your project.



If you want to use pre-built SFML libraries, then you don't need any of the SFML source code.
Neither do you need the extlibs directory or build anything with CMake.

So I tried to do some things before I came here looking for more help. I tried another fresh build, this time using...

[GCC] 7.3.0 MinGW (DW2) - 32-bit

MinGW Builds 7.3.0 (32-bit)

The tutorial I followed EXACT (again).
So... here are my settings.



This shows library listings for the all configuration (e.g. when you select SFML > Linker settings). You shouldn't list any libraries in there.
Then you're also mixing shared libraries for debug and static libraries for release, which is probably not what you want.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kain Nobel

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Fresh Build - Problems Galore
« Reply #4 on: February 04, 2022, 09:37:59 am »
Hahaha! That was a quick 2 second fix, thank you! SOLVED :)

I'm a little slow on the uptake (it's a lot of information to absorb at once.) I think the problem started when CLion was needing me to do something with CMake. I'm going to continue with this CLion trial but it is now compiling and linking to MY project which was the most important thing to me :D

Now I can get back to the Keyboard extension I was writing. This is pretty cool. If I finish it and it works I'll let you check it out, you'd be more than welcome to include it in the official SFML because it's pretty standard. :)

Off to test out the new Keyboard then I'll be giving the same treatment to Mouse and Joystick! :D

Slightly Off Topic : Untested Brand New Keyboard Preview!

Preview of the code is below if you want to give it a try. (I haven't even tested it yet, outside of when I was writing it @ onlinegdb.com. If anybody tests or modifies it, PM me with the new version. The only thing I haven't added was a 'isDoubleTap()' function and it'll probably be converted to a sf::Vector3 to replace m_SYNC, m_States and maybe m_DblTime to check for each and every key double tap. (Onlinegdb doesn't have sf::Vector3 obviously but it sounds like a good class to use for this. Maybe.))

Keyboard.hpp
(click to show/hide)

(click to show/hide)

Other than that, this topic is SOLVED, thank you for all your help!
« Last Edit: February 04, 2022, 09:42:32 am by Kain Nobel »

ozenzop

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Fresh Build - Problems Galore [Hahaha SOLVED XD]
« Reply #5 on: April 18, 2022, 08:49:49 pm »
I was having CMake file problems so I decided to clear all my CMake files, then I decided to just clear the whole library and start over because another 8 hour night of heroic measures trying to build is uncalled for.