Try to learn OpenGL

>try to learn OpenGL
>you can't even install GLFW with CMake because of some stupid error
well fuck I tried

Attached: 1564074482446.jpg (540x413, 24K)

Other urls found in this thread:

lucasg.github.io/Dependencies/
twitter.com/NSFWRedditImage

bu,p

Do you know C++ or are you trying to learn both at the same time?

retarded thread for a retarded OP

had the same problem, CMake is retarded i already knew openGL just couldnt install glfw with that retardation

both

>cmake
There's your problem.
Write the make files yourself

tutorials use Cmake I would probably fuck something up myself

What OS are you using?

windows 10 ltsc 2019

Are you using vcpkg to manage your dependencies? If not, you should try using that.

What error are you getting? Also post your CMakeLists.txt.

thanks I will check that
I'm getting some missing dll file but it's in the MinGW folder in CodeBlocks, both the MinGW folder and MinGW32 folder
also I run Cmake as administrator I don't know what's wrong

I would definitely recommend using vcpkg cause it exports cmake targets that automatically handle the include directory and library location. all you have to do is add the following to the command line when you build cmake:
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake


That path may vary based on where you install vcpkg. For SDL2 you need to add the following cmake dependencies: SDL2::SDL2 and SDL2::SDL2main.
SDL2::SDL2 is the main SDL2 library and SDL2::SDL2main is a small library that just defines the function winmain which is the entry point for all GUI applications on Windows (as opposed to int main(int argc, char* argv[]) on most other platforms).

SDL2 is a bit complicated cause of that but it allows you to always start your program with main on all platforms.

>all you have to do is add the following to the command line when you build cmake

I meant, when you run the cmake command.

thanks when I will be on my PC I will try that

fuck my brain, i forgot that your using mingw. Are you using a package manager like msys2?

Often with mingw, some IDEs may not set the dll search path properly when you try to run your application it wont be able to find the dlls. I honestly just gave up and copied the required dlls to my executable directory. You can use a dependency checker to see what non-system dlls are needed.

lucasg.github.io/Dependencies/ seemed to work for me and unlike dependencywalker, it didn't take 5 mins to load each time.

In linux is just apt install libglfw3-dev
And to compile g++ -lglfw3 etc...

I don't. Just Code::Blocks as IDE
but thanks for the link I will see if that works
you mean once per project? sorry I still don't know how the hell libraries work

got

also worked for me the first time so idk what you're doing wrong

I use conan so try that

whenever you use a compiler it has to know where the libraries are so that they can inject (static linking) or link (dynamic linking) the library's code to your application. Many compilers have some default areas they search, like C:\Windows\System32 on Windows or /usr/lib on Linux flavours. But you usually don't want to clutter up these areas with all your own libraries.
You can either pass in a custom directory to whichever compiler you use every time you call it, but that's awkward and difficult, so most people use CMake. You tell CMake where your libraries are and it will automatically generate the compile commands and/or IDE projects for whatever platform you're using (GCC or LLVM or Visual Studio or Makefiles or whatever).
cmake --build will compile your project with whatever configuration CMake thinks is best.

CMake is really easy to use with a Dependency Manager such as Conan or vcpkg (personally I use Conan), because they will automatically download all libraries, dlls, .so, and header files you need to work with. That way the configuration you have to actually do in CMake is minimal. Conan has a generator called cmake_find_package which will generate a CMake package for you, so that in your CMakeLists.txt all you have to write is find_package(glfw) and there it is, all ready to be linked with target_link_libraries(${PROJECT_NAME}, glfw::glfw) and now you have 100% working GLFW library to use immediately.

you realize you don't need glfw for any reason right

>using windows
>trying to write something in c++ and not using MSVC

Don't even bother trying. Even at my work the official wincuck solution for c++ development was a linux vm.

Shit my miss. I tested the example code from glfw.org and the correct line is g++ main.cpp -lGL -lglfw

works fine for me desu

Attached: conan-cmake.png (960x1040, 49K)

>Don't even bother trying. Even at my work the official wincuck solution for c++ development was a linux vm.
But Jow Forums told me that Linucks is unusable and made by volunteer NEETs, while Windows is made by professional and just werks, what gives?

Attached: 1555718995173.png (434x327, 55K)

thanks friend, I guess I understand it now
yeah after this thread I seriously consider switching to linux on my thinkpad and do all the programming there while having windows on pc just for games

came here after 4 a year break and this is probably the first reply to a thread I read, is this really what Jow Forums thinks now?

In windows dealing with 3rd party dependencies is a fucking mess.

If you're willing to use an expensive ass M$ kosher toolchain and IDE, go nuts. It works beautifully.

But if not, mingw has horrifically long linking times and I hope you're willing to learn all the dll bullshit you have to know and configure.
I can't imagine how anyone uses mingw on massive software with nearly half a million or more lines of c++ code.