Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpick v0.3 compil fail on Archlinux #211

Closed
PowaBanga opened this issue Aug 30, 2022 · 1 comment
Closed

gpick v0.3 compil fail on Archlinux #211

PowaBanga opened this issue Aug 30, 2022 · 1 comment

Comments

@PowaBanga
Copy link

Hi everybody,
gpick crash on start on my archlinux :

/usr/include/c++/12.1.0/bits/basic_string.h:1280: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::front() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&]: Assertion '!empty()' failed.
[1]    5307 IOT instruction (core dumped)  gpick

does anybody know why ?

@PowaBanga
Copy link
Author

PowaBanga commented Sep 8, 2022

ok on archlinux, gpick is actualy on v0.2.6.
Compil of the v0.3 fail... after read this #209 (comment) i created my own PKGBUILD on the V0.3 release with my diff to patch in, and it worked !

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb6c670..5141263 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,8 +30,8 @@ if (PkgConfig_FOUND)
 		pkg_check_modules(GTK2 gtk+-2.0>=2.24)
 		pkg_check_modules(GioUnix gio-unix-2.0>=2.24)
 	endif()
-	pkg_search_module(Lua lua5.4-c++>=5.4 lua5-c++>=5.4 lua5.3-c++>=5.3 lua5-c++>=5.3 lua-c++>=5.3 lua5.2-c++>=5.2 lua-c++>=5.2)
-	pkg_check_modules(Expat expat>=1.0)
+	pkg_search_module(Lua lua5.4>=5.4 lua5>=5.4 lua5.3>=5.3 lua5>=5.3 lua>=5.3 lua5.2>=5.2 lua>=5.2)
+    pkg_check_modules(Expat expat>=1.0)
 endif()
 set(THREADS_PREFER_PTHREAD_FLAG ON)
 find_package(Threads REQUIRED)
diff --git a/source/ColorSpaceType.cpp b/source/ColorSpaceType.cpp
index 8f5d124..a1c0c22 100644
--- a/source/ColorSpaceType.cpp
+++ b/source/ColorSpaceType.cpp
@@ -22,7 +22,9 @@
 #include "lua/Color.h"
 #include "lua/Script.h"
 #include "lua/Callbacks.h"
+extern "C" {
 #include <lua.h>
+}
 #include <iostream>
 using namespace std;
 
diff --git a/source/Converter.cpp b/source/Converter.cpp
index ee9d7d7..9e82b34 100644
--- a/source/Converter.cpp
+++ b/source/Converter.cpp
@@ -33,8 +33,10 @@
 #include <vector>
 #include <iostream>
 #include <functional>
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 using namespace std;
 Converter::Converter(const char *name, const char *label, lua::Ref &&serialize, lua::Ref &&deserialize):
 	m_name(name),
diff --git a/source/GlobalState.cpp b/source/GlobalState.cpp
index ca6542b..c848141 100644
--- a/source/GlobalState.cpp
+++ b/source/GlobalState.cpp
@@ -37,8 +37,10 @@
 #include <filesystem>
 #include <stdlib.h>
 #include <glib/gstdio.h>
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 #include <fstream>
 #include <iostream>
 struct GlobalState::Impl {
diff --git a/source/layout/Layout.cpp b/source/layout/Layout.cpp
index c81a927..6ba7bf9 100644
--- a/source/layout/Layout.cpp
+++ b/source/layout/Layout.cpp
@@ -20,8 +20,10 @@
 #include "System.h"
 #include "../lua/Layout.h"
 #include <iostream>
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 using namespace std;
 namespace layout
 {
diff --git a/source/lua/Color.cpp b/source/lua/Color.cpp
index 724831a..47d6bf4 100644
--- a/source/lua/Color.cpp
+++ b/source/lua/Color.cpp
@@ -18,8 +18,10 @@
 
 #include "Color.h"
 #include "../Color.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 static int newColor(lua_State *L)
diff --git a/source/lua/ColorObject.cpp b/source/lua/ColorObject.cpp
index a1971b5..19f15e6 100644
--- a/source/lua/ColorObject.cpp
+++ b/source/lua/ColorObject.cpp
@@ -20,8 +20,10 @@
 #include "Color.h"
 #include "Script.h"
 #include "../ColorObject.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 static int newColorObject(lua_State *L)
diff --git a/source/lua/DynvSystem.cpp b/source/lua/DynvSystem.cpp
index ff3508c..dfbba25 100644
--- a/source/lua/DynvSystem.cpp
+++ b/source/lua/DynvSystem.cpp
@@ -17,8 +17,10 @@
  */
 
 #include "DynvSystem.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua {
 dynv::Ref checkDynvSystem(lua_State *L, int index) {
 	void *ud = luaL_checkudata(L, index, "dynvSystem");
diff --git a/source/lua/Extensions.cpp b/source/lua/Extensions.cpp
index 62c6c1b..6e14e84 100644
--- a/source/lua/Extensions.cpp
+++ b/source/lua/Extensions.cpp
@@ -31,8 +31,10 @@
 #include "../Converters.h"
 #include "../Converter.h"
 #include "version/Version.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 static void checkArgumentIsFunctionOrNil(lua_State *L, int index)
diff --git a/source/lua/GlobalState.cpp b/source/lua/GlobalState.cpp
index 8908538..984bb91 100644
--- a/source/lua/GlobalState.cpp
+++ b/source/lua/GlobalState.cpp
@@ -18,8 +18,10 @@
 
 #include "GlobalState.h"
 #include "../GlobalState.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 void setGlobalState(lua_State *L, GlobalState &global_state)
diff --git a/source/lua/I18N.cpp b/source/lua/I18N.cpp
index 6791c97..f7fd0e6 100644
--- a/source/lua/I18N.cpp
+++ b/source/lua/I18N.cpp
@@ -18,8 +18,10 @@
 
 #include "I18N.h"
 #include "../I18N.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 int getText(lua_State *L)
diff --git a/source/lua/Layout.cpp b/source/lua/Layout.cpp
index be83686..b2dfd2b 100644
--- a/source/lua/Layout.cpp
+++ b/source/lua/Layout.cpp
@@ -23,8 +23,10 @@
 #include "../layout/Box.h"
 #include "../layout/System.h"
 #include "../layout/Layout.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 #include <typeinfo>
 #include <iostream>
 using namespace std;
diff --git a/source/lua/Ref.cpp b/source/lua/Ref.cpp
index 9b1acc7..96c108f 100644
--- a/source/lua/Ref.cpp
+++ b/source/lua/Ref.cpp
@@ -17,8 +17,10 @@
  */
 
 #include "Ref.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 Ref::Ref():
diff --git a/source/lua/Script.cpp b/source/lua/Script.cpp
index a39e3eb..6358327 100644
--- a/source/lua/Script.cpp
+++ b/source/lua/Script.cpp
@@ -18,8 +18,10 @@
 
 #include "Script.h"
 #include <sstream>
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 #include <iostream>
 using namespace std;
 namespace lua
diff --git a/source/test/Script.cpp b/source/test/Script.cpp
index 8fdeaa9..55a6c3e 100644
--- a/source/test/Script.cpp
+++ b/source/test/Script.cpp
@@ -19,8 +19,10 @@
 #include <boost/test/unit_test.hpp>
 #include "lua/Script.h"
 #include "common/Scoped.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 using namespace lua;
 static int test(lua_State *L) {
 	lua_pushstring(L, "ok");
diff --git a/source/uiDialogOptions.cpp b/source/uiDialogOptions.cpp
index e70debb..b072944 100644
--- a/source/uiDialogOptions.cpp
+++ b/source/uiDialogOptions.cpp
@@ -28,8 +28,10 @@
 #include "lua/Callbacks.h"
 #include <string>
 #include <iostream>
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 using namespace std;
 static const struct{
 	const char *label;

@PowaBanga PowaBanga changed the title gpick crash on start gpick v0.3 compil fail on Archlinux Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant