espanso / espanso

Cross-platform Text Expander written in Rust
https://espanso.org
GNU General Public License v3.0
9.91k stars 275 forks source link

error: use of undeclared identifier 'DEFAULT_STYLE' #1859

Open yurivict opened 7 months ago

yurivict commented 7 months ago

Describe the bug Build fails:

  running: "c++" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-O2" "-pipe" "-fstack-protector-strong" "-isystem" "/usr/local/include" "-fno-strict-aliasing" "-I/usr/local/include/libepoll-shim" "-isystem" "/usr/local/include" "-std=c++17" "-I/usr/local/lib/wx/include/gtk2-unicode-3.2" "-I/usr/local/include/wx-3.2" "-D_FILE_OFFSET_BITS=64" "-DWXUSINGDLL" "-D__WXGTK__" "-pthread" "-D_THREAD_SAFE" "-o" "/usr/ports/textproc/espanso/work/target/x86_64-unknown-freebsd/release/build/espanso-modulo-bcac5c9a490022d1/out/src/sys/search/search.o" "-c" "src/sys/search/search.cpp"
  cargo:warning=src/sys/search/search.cpp:176:49: error: use of undeclared identifier 'DEFAULT_STYLE'
  cargo:warning=    : wxFrame(NULL, wxID_ANY, title, pos, size, DEFAULT_STYLE)
  cargo:warning=                                                ^
  cargo:warning=src/sys/search/search.cpp:219:23: error: use of undeclared identifier 'SEARCH_BAR_FONT_SIZE'
  cargo:warning=    font.SetPointSize(SEARCH_BAR_FONT_SIZE);
  cargo:warning=                      ^
  cargo:warning=2 errors generated.
  exit status: 1

wx32-gtk2-3.2.4_1 is used.

To Reproduce Steps to reproduce the behavior: 1.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots or screen recordings to help explain your problem.

Logs If possible, run espanso log in a terminal after the bug has occurred, then post the output here so that we can better diagnose the problem

Setup information

smeech commented 7 months ago

https://github.com/espanso/espanso/blob/c4b3d5ae279807ce1fd146e1219aa063685c021a/espanso-modulo/src/sys/search/search.cpp#L33-45 defines it, but again by OS, specified with different codes this time. As I feared - there may be multiple places where the code specifies Windows, macOS and Linux, but not FreeBSD. The only other definition I can find is https://github.com/espanso/espanso/blob/c4b3d5ae279807ce1fd146e1219aa063685c021a/espanso-modulo/src/sys/form/form.cpp#L30 but without OS-specific configuration.

AucaCoyan commented 7 months ago

Yeah, I think we have mixed support for FreeBSD. For starters, we don't compile any binary. I've just checked and apparently wx is supported in FreeBSD. From its website

wxGTK: wxGTK2 and wxGTK3 are the ports using GTK+ library version 2.x and 3.x respectively. They are very similar, with wxGTK2 being, however, more mature. Both ports work on almost any Unix system (Linux, FreeBSD, OpenBSD, NetBSD, Solaris, AIX, ...) and require GTK+ 2.6 or later or GTK+ 3.x. The primary supported compiler is GNU g++.

But I don't know how much C++ code we need to write to make it possible. I also personally can't do it because I'm a noob in C++