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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - splavacado100

Pages: [1]
1
General / Running SFML with no console without Visual Studio
« on: December 10, 2020, 08:59:47 pm »
I realize this question has been asked many times before, and if I was using Visual Studios, the answer would be to link the sfml-main.lib and change the project type to Window. However, I have a different IDE I prefer so I set up the below batch file to build the executable for me.

@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
cl /EHsc source\*.cpp /I "C:\SFML\include" /link C:\SFML\lib\sfml-system.lib C:\SFML\lib\sfml-window.lib C:\SFML\lib\sfml-graphics.lib C:\SFML\lib\sfml-audio.lib C:\SFML\lib\sfml-main.lib /out:PhantomEmber.exe
del *.obj
move PhantomEmber.exe build
pause


The libraries are all the dynamic release versions, with the corresponding dll files in the same directory as the exe, and I made sure to get the correct version of SFML (64bit, for VS 2017 Windows 10). I call the vcvars64.bat to initialize the 64bit MSVC compiler, and then link everything together using the cl command. I am linking the sfml-main.lib, but is there another arguement I need to put in the script that is the equivelent of setting it a Windows project? Or is the only way to get the window with no console is by just building it with Visual Studios? Other than the console, everything compiles and runs fine. Let me know if there is anything about my setup/code thats important.

Pages: [1]