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

Author Topic: Fail to Build Project  (Read 12245 times)

0 Members and 2 Guests are viewing this topic.

Kruznova

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Fail to Build Project
« on: May 02, 2024, 02:49:54 pm »
I was trying to build my game pretty similar to doodle jump but then I've got a lot of errors in sfml-systme.lib file. You can see them on the picture
« Last Edit: May 02, 2024, 02:54:11 pm by eXpl0it3r »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Fail to Build Project
« Reply #1 on: May 02, 2024, 02:55:20 pm »
Are you #include-ing the lib file instead of a header file?

You need to provide more information on what you're doing in order for us to help and not just make random guesses.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kruznova

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Fail to Build Project
« Reply #2 on: May 02, 2024, 02:57:31 pm »
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <cstdlib>
#include <ctime>
#include <iostream>

That's what I am including in this file nothing more

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Fail to Build Project
« Reply #3 on: May 02, 2024, 03:06:19 pm »
How are you linking SFML?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kruznova

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Fail to Build Project
« Reply #4 on: May 02, 2024, 03:12:01 pm »
I linked it in project properties

C/C++ » General » Additional Include Directories   D:\SFML\SFML-2.6.1\include
Linker » General » Additional Library Directories     D:\SFML\SFML-2.6.1\lib
Also I've added Additional Dependencies    sfml-graphics.lib, sfml-window.lib and sfml-system.lib

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Fail to Build Project
« Reply #5 on: May 02, 2024, 03:51:13 pm »
Double check the config with the tutorial, you must have done some mistake somewhere to get the shown error output.

Provide the verbose build output, so we can see the complete configuration: https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kruznova

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Fail to Build Project
« Reply #6 on: May 02, 2024, 03:58:48 pm »
I've checked tutorial again and there was no mistakes.

Build gave me this:
Build started...
1>------ Build started: Project: yes2, Configuration: Debug Win32 ------
1>Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30146 for x86
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>cl /c /I"D:\SFML\SFML-2.6.1\include" /ZI /JMC /W3 /WX- /diagnostics:column /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc142.pdb" /external:W3 /Gd /TP /analyze- /FC /errorReport:prompt Source.cpp
1>Source.cpp
1>C:\Users\artio\source\repos\yes2\yes2\Source.cpp(32,15): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data
1>C:\Users\artio\source\repos\yes2\yes2\Source.cpp(75,67): warning C4244: 'argument': conversion from 'int' to 'float', possible loss of data
1>C:\Users\artio\source\repos\yes2\yes2\Source.cpp(99,47): warning C4244: 'argument': conversion from 'const int' to 'float', possible loss of data
1>C:\Users\artio\source\repos\yes2\yes2\Source.cpp(99,35): warning C4244: 'argument': conversion from 'const int' to 'float', possible loss of data
1>Microsoft (R) Incremental Linker Version 14.29.30146.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>"/OUT:C:\Users\artio\source\repos\yes2\Debug\yes2.exe" /INCREMENTAL "/ILK:Debug\yes2.ilk" "/LIBPATH:D:\SFML\SFML-2.6.1\lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG "/PDB:C:\Users\artio\source\repos\yes2\Debug\yes2.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:C:\Users\artio\source\repos\yes2\Debug\yes2.lib" /MACHINE:X86 Debug\Source.obj
1>LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
1>Done building project "yes2.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Fail to Build Project
« Reply #7 on: May 02, 2024, 04:23:27 pm »
Make sure your configuration is for the correct compiler architecture (Win32 vs x64) and config (Debug vs Release). Note how no SFML libraries are listed above.

Also don't delete %(AdditionalLibraryDirectories) from the Additional Library Directory, otherwise the linker might fail to find system libraries.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/