faresbakhit / ayin Goto Github PK
View Code? Open in Web Editor NEWAyin is a free and open source photo editing software available on Windows, Linux, and MacOS
License: GNU General Public License v3.0
Ayin is a free and open source photo editing software available on Windows, Linux, and MacOS
License: GNU General Public License v3.0
This doesn't compile on Linux because the below error is thrown when I run the make
or make mode=release
command in project directory.
Makefile:42: *** unsupported platform: debug. Stop.
I fixed the above by adding the following into the Makefile
ifeq ($(OS),Windows_NT)
LDFLAGS += -mwindows -lopengl32 -luuid -ldwmapi
ifeq ($(mode),debug)
LDFLAGS += -mconsole `pkg-config --libs sdl2 freetype2`
else
LDFLAGS += -static `pkg-config --static --libs sdl2 freetype2`
endif
CXXFLAGS += `pkg-config --cflags sdl2 freetype2`
OBJECTS += $(BUILDDIR)/icon.o
else
ifeq ($(shell uname),Linux) # added this
LDFLAGS += `pkg-config --libs sdl2 freetype2`
CXXFLAGS += `pkg-config --cflags sdl2 freetype2`
else
$(error unsupported platform: $(mode))
endif
endif
But then this error was thrown
g++ -c -o target/debug/Main.o src/Main.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/Commands.o src/Commands.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/Image.o src/Image.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/ImageFilter.o src/ImageFilter.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/Application.o src/Application.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
src/Application.cpp: In member function ‘bool bps::Application::init(const char*)’:
src/Application.cpp:255:28: error: ‘style’ was not declared in this scope; did you mean ‘strlen’?
255 | ImGui::StyleColorsDark(style);
| ^~~~~
| strlen
make: *** [Makefile:57: target/debug/Application.o] Error 1
Since style
variable is not defined anywhere in Application.cpp
I removed it because the function ImGui::StyleColorsDark()
has a default parameter set to NULL
.
Then compiling after this I got this error
g++ -c -o target/debug/Application.o src/Application.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/imgui.o lib/imgui/imgui.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/imgui_draw.o lib/imgui/imgui_draw.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/imgui_tables.o lib/imgui/imgui_tables.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/imgui_widgets.o lib/imgui/imgui_widgets.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/imgui_freetype.o lib/imgui/misc/freetype/imgui_freetype.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/imgui_impl_sdl2.o lib/imgui/backends/imgui_impl_sdl2.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/imgui_impl_opengl3.o lib/imgui/backends/imgui_impl_opengl3.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/debug/portable-file-dialogs.o lib/portable-file-dialogs/portable-file-dialogs.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -g -O0 `pkg-config --cflags sdl2 freetype2`
g++ -o target/debug/ayin target/debug/Main.o target/debug/Commands.o target/debug/Image.o target/debug/ImageFilter.o target/debug/Application.o target/debug/imgui.o target/debug/imgui_draw.o target/debug/imgui_tables.o target/debug/imgui_widgets.o target/debug/imgui_freetype.o target/debug/imgui_impl_sdl2.o target/debug/imgui_impl_opengl3.o target/debug/portable-file-dialogs.o `pkg-config --libs sdl2 freetype2`
/usr/bin/ld: target/debug/Image.o: in function `bps::Image::~Image()':
/home/hammad/Code/side/ayin/src/Image.cpp:30:(.text+0x20cc2): undefined reference to `glDeleteTextures'
/usr/bin/ld: target/debug/Image.o: in function `bps::Image::load(char const*)':
/home/hammad/Code/side/ayin/src/Image.cpp:39:(.text+0x20d13): undefined reference to `glDeleteTextures'
/usr/bin/ld: target/debug/Image.o: in function `bps::Image::load_texture()':
/home/hammad/Code/side/ayin/src/Image.cpp:68:(.text+0x20f05): undefined reference to `glDeleteTextures'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:71:(.text+0x20f35): undefined reference to `glGenTextures'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:72:(.text+0x20f48): undefined reference to `glBindTexture'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:74:(.text+0x20f5c): undefined reference to `glTexParameteri'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:75:(.text+0x20f70): undefined reference to `glTexParameteri'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:76:(.text+0x20f84): undefined reference to `glTexParameteri'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:77:(.text+0x20f98): undefined reference to `glTexParameteri'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:79:(.text+0x20fa7): undefined reference to `glPixelStorei'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:80:(.text+0x20fe9): undefined reference to `glTexImage2D'
/usr/bin/ld: target/debug/Image.o: in function `bps::Image::update_texture() const':
/home/hammad/Code/side/ayin/src/Image.cpp:86:(.text+0x2102a): undefined reference to `glBindTexture'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:87:(.text+0x21039): undefined reference to `glPixelStorei'
/usr/bin/ld: /home/hammad/Code/side/ayin/src/Image.cpp:88:(.text+0x2107b): undefined reference to `glTexSubImage2D'
collect2: error: ld returned 1 exit status
make: *** [Makefile:54: target/debug/ayin] Error 1
Now that's a problem with OpenGL function not defined so I fixed it by adding this to Makefile
LDFLAGS += -lGL
Then it compiled with these warnings in release mode
mkdir -p target/release
g++ -c -o target/release/Main.o src/Main.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
src/Main.cpp: In function ‘int main(int, char**)’:
src/Main.cpp:125:61: warning: ‘photo’ may be used uninitialized [-Wmaybe-uninitialized]
125 | ImGui::BeginDisabled(!photo->can_undo_change());
| ~~~~~~~~~~~~~~~~~~~~~~^~
src/Main.cpp:61:21: note: ‘photo’ was declared here
61 | bps::Photo* photo;
| ^~~~~
g++ -c -o target/release/Commands.o src/Commands.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/Image.o src/Image.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/ImageFilter.o src/ImageFilter.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/Application.o src/Application.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/imgui.o lib/imgui/imgui.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/imgui_draw.o lib/imgui/imgui_draw.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/imgui_tables.o lib/imgui/imgui_tables.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/imgui_widgets.o lib/imgui/imgui_widgets.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/imgui_freetype.o lib/imgui/misc/freetype/imgui_freetype.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/imgui_impl_sdl2.o lib/imgui/backends/imgui_impl_sdl2.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/imgui_impl_opengl3.o lib/imgui/backends/imgui_impl_opengl3.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -c -o target/release/portable-file-dialogs.o lib/portable-file-dialogs/portable-file-dialogs.cpp -Iincludes -Ilib/imgui -Ilib/imgui/backends -Ilib/imgui/misc/freetype -Ilib/portable-file-dialogs -Ilib/stb -std=c++17 -Wall -Wextra -Wno-missing-field-initializers -Wno-missing-braces -O3 -DNDEBUG `pkg-config --cflags sdl2 freetype2`
g++ -o target/release/ayin target/release/Main.o target/release/Commands.o target/release/Image.o target/release/ImageFilter.o target/release/Application.o target/release/imgui.o target/release/imgui_draw.o target/release/imgui_tables.o target/release/imgui_widgets.o target/release/imgui_freetype.o target/release/imgui_impl_sdl2.o target/release/imgui_impl_opengl3.o target/release/portable-file-dialogs.o -lGL `pkg-config --libs sdl2 freetype2`
The app opens but the CTRL + O
to open a file for editing doesn't work. My systems default file manager (GNOME Files) is never opened to pick a file. Note the CTRL + Q
option to close the program does work.
Here is the output of uname -a
command
Linux arch 6.8.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 11 Apr 2024 01:47:33 +0000 x86_64 GNU/Linux
Let me know if you need additional info
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.