casouri / xeft

Fast, interactive Emacs note searching
91 stars 8 forks source link

An error while trying to build the module #1

Closed tareefdev closed 3 years ago

tareefdev commented 3 years ago
xeft-module.cc:332:33: error: invalid conversion from ‘emacs_subr’ {aka ‘emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*)’} to ‘emacs_value_tag* (*)(emacs_env*, ptrdiff_t, emacs_value_tag**, void*) noexcept’ {aka ‘emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*) noexcept’} [-fpermissive]
  332 |     (env, min_arity, max_arity, function, documentation, NULL);
      |                                 ^~~~~~~~
      |                                 |
      |                                 emacs_subr {aka emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*)}
make: *** [Makefile:9: xeft-module.so] Error 1
casouri commented 3 years ago

Thanks for testing, should be fixed by af94f77.

tareefdev commented 3 years ago

Got another error, thanks for your efforts here

[tareef@dell xeft]$ make PREFIX=/opt/local
g++ -shared -fPIC -I/opt/local/include -L/opt/local/lib -lxapian xeft-module.cc -o xeft-module.so
In file included from /usr/include/xapian.h:44,
                 from xeft-module.cc:19:
/usr/include/xapian/version.h:29:2: warning: #warning The C++ ABI version of compiler you are using does not exactly match [-Wcpp]
   29 | #warning The C++ ABI version of compiler you are using does not exactly match
      |  ^~~~~~~
/usr/include/xapian/version.h:30:2: warning: #warning that of the compiler used to build the library. If linking fails [-Wcpp]
   30 | #warning that of the compiler used to build the library. If linking fails
      |  ^~~~~~~
/usr/include/xapian/version.h:31:2: warning: #warning due to missing symbols, this is probably the reason why. [-Wcpp]
   31 | #warning due to missing symbols, this is probably the reason why.
      |  ^~~~~~~
/usr/include/xapian/version.h:32:2: warning: #warning The Xapian library was built with g++ 10.2.0 [-Wcpp]
   32 | #warning The Xapian library was built with g++ 10.2.0
      |  ^~~~~~~
xeft-module.cc: In function ‘int emacs_module_init(emacs_runtime*)’:
xeft-module.cc:502:19: error: invalid conversion from ‘emacs_value_tag* (*)(emacs_env*, ptrdiff_t, emacs_value_tag**, void*)’ {aka ‘emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*)’} to ‘emacs_subr’ {aka ‘emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*) noexcept’} [-fpermissive]
  502 |                   &Fxeft_reindex_file, xeft_reindex_file_doc);
      |                   ^~~~~~~~~~~~~~~~~~~
      |                   |
      |                   emacs_value_tag* (*)(emacs_env*, ptrdiff_t, emacs_value_tag**, void*) {aka emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*)}
xeft-module.cc:329:34: note:   initializing argument 5 of ‘void define_function(emacs_env*, const char*, ptrdiff_t, ptrdiff_t, emacs_subr, const char*)’
  329 |  ptrdiff_t max_arity, emacs_subr function, const char *documentation)
      |                       ~~~~~~~~~~~^~~~~~~~
xeft-module.cc:504:19: error: invalid conversion from ‘emacs_value_tag* (*)(emacs_env*, ptrdiff_t, emacs_value_tag**, void*)’ {aka ‘emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*)’} to ‘emacs_subr’ {aka ‘emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*) noexcept’} [-fpermissive]
  504 |                   &Fxeft_query_term, xeft_query_term_doc);
      |                   ^~~~~~~~~~~~~~~~~
      |                   |
      |                   emacs_value_tag* (*)(emacs_env*, ptrdiff_t, emacs_value_tag**, void*) {aka emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*)}
xeft-module.cc:329:34: note:   initializing argument 5 of ‘void define_function(emacs_env*, const char*, ptrdiff_t, ptrdiff_t, emacs_subr, const char*)’
  329 |  ptrdiff_t max_arity, emacs_subr function, const char *documentation)
      |                       ~~~~~~~~~~~^~~~~~~~
make: *** [Makefile:9: xeft-module.so] Error 1
casouri commented 3 years ago

I think I know what's going on now. 1bfabb2 should fix it. Thanks!

casouri commented 3 years ago

Actually hold for a minute, it still have problems with gcc.

casouri commented 3 years ago

Maybe give it a try. The gcc on my linux server and clang on my Mac can compile just fine, but the gcc I installed on my Mac gives errors.

Nathan-Furnal commented 3 years ago

Hi! I'm trying to build the module as well on Linux and I get the following error :

g++ xeft-module.cc -o xeft-module.so -shared -fPIC -I/opt/local/include -L/opt/local/lib -lxapian
Dans le fichier inclus depuis /usr/include/xapian.h:44,
                 depuis xeft-module.cc:19:
/usr/include/xapian/version.h:29:2: attention: #warning The C++ ABI version of compiler you are using does not 
exactly match [-Wcpp]
   29 | #warning The C++ ABI version of compiler you are using does not exactly match
      |  ^~~~~~~
/usr/include/xapian/version.h:30:2: attention: #warning that of the compiler used to build the library. If link
ing fails [-Wcpp]
   30 | #warning that of the compiler used to build the library. If linking fails
      |  ^~~~~~~
/usr/include/xapian/version.h:31:2: attention: #warning due to missing symbols, this is probably the reason why
. [-Wcpp]
   31 | #warning due to missing symbols, this is probably the reason why.
      |  ^~~~~~~
/usr/include/xapian/version.h:32:2: attention: #warning The Xapian library was built with g++ 10.2.0 [-Wcpp]
   32 | #warning The Xapian library was built with g++ 10.2.0
      |  ^~~~~~~
xeft-module.cc: Dans la fonction « void define_function(emacs_env*, const char*, ptrdiff_t, ptrdiff_t, emacs_su
br, const char*) »:
xeft-module.cc:332:33: erreur: conversion invalide de « emacs_subr » {aka « emacs_value_tag* (*)(emacs_env_28*,
 long int, emacs_value_tag**, void*) »} vers « emacs_value_tag* (*)(emacs_env*, ptrdiff_t, emacs_value_tag**, v
oid*) noexcept » {aka « emacs_value_tag* (*)(emacs_env_28*, long int, emacs_value_tag**, void*) noexcept »} [-f
permissive]
  332 |     (env, min_arity, max_arity, function, documentation, NULL);
      |                                 ^~~~~~~~
      |                                 |
      |                                 emacs_subr {aka emacs_value_tag* (*)(emacs_env_28*, long int, emacs_val
ue_tag**, void*)}
make: *** [Makefile:9 : xeft-module.so] Erreur 1

From my understanding, there's something wrong about the function definition and the exception but since I do not use C/C++ it's difficult to tell.

casouri commented 3 years ago

It should be fixed now. Could please you verify that for me?

Nathan-Furnal commented 3 years ago

Yes it does! Thanks a lot =) I had to build the ~/.deft/db by hand though as it error'ed out when I hadn't.

Also, here is my current config in case someone wants to try it out.

(use-package "xeft"
  :load-path "site-lisp/xeft"
  :ensure nil
  :defer t
  :custom
  (xeft-directory "~/projects/notes")
  :commands (xeft))
casouri commented 3 years ago

Ah, it didn't auto create the database because you put the database and notes in different directories. I've fixed that problem. Thanks for reporting!

Nathan-Furnal commented 3 years ago

Thanks for replying so quicky!

tareefdev commented 3 years ago

I have built the module using the latest version and it went flawlessly. Thanks.