'Translating imgui .bat files to g++ build scripts
I am better trying to understand libraries, linking and shared object files on linux. The Dear imgui library includes some test cases, but to build these files I have to translate the included bat files to a .sh file which does all the same actions.
The included batch file is:
@REM Build for Visual Studio compiler. Run your copy of amd64/vcvars32.bat to setup 64-bit command-line compiler.
@set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include /I %VULKAN_SDK%\include
@set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp
@set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-64 /libpath:%VULKAN_SDK%\lib glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib
@set OUT_DIR=Debug
mkdir %OUT_DIR%
cl /nologo /Zi /MD %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS%
@set OUT_DIR=Release
mkdir %OUT_DIR%
cl /nologo /Zi /MD /Ox /Oi %INCLUDES% /D ImTextureID=ImU64 %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS%
So far I have this written for my bash script:
#!/bin/bash
g++ -I /$(pwd)/../.. /$(pwd)/../../backends /$(pwd)/..libs/glfw/include/ -L /$(pwd)/../libs -Wall -g -o vulkan_test.bin ./main.cpp -lstdc++fs -std=c++17
I have also installed the vulkan SDK and have found the .so files in /usr/lib/x86_64-linux-gnu. I also built the libglfw3.a and i have openGL somewhere as well. gdi32 seems to be windows specific and shell32.lib is a qt tool which is kinda strange considering I thought imgui was a QT alternative.
So what is the difference between a library (presumable -L), an included file and source? And I would love if someone just posted a script which gets me closer to a place where I can build the main.cpp file included as a test for vulkan for imgui.
Can anyone drop some powerful computing insight onto this so I can try to try to do this on my own in the future?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
