On 06-Sep-2019 07:04, Bram Moolenaar wrote:
Patch 8.1.1991
Problem:    Still cannot build with eval but without cscope.
Solution:   Move f_cscope_connection() outside of #ifdef.
Files:      src/if_cscope.c



After this patch gcc throws this linker error (FEAT_CSCOPE is disabled):

<snip>

gcc -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -Wl,-nxcompat,-dynamicbase -mwindows -municode -s -o gvim.exe gobjnative/arabic.o gobjnative/arglist.o gobjnative/autocmd.o gobjnative/beval.o gobjnative/blob.o gobjnative/blowfish.o gobjnative/buffer.o gobjnative/change.o gobjnative/charset.o gobjnative/cmdexpand.o gobjnative/cmdhist.o gobjnative/crypt.o gobjnative/crypt_zip.o gobjnative/debugger.o gobjnative/dict.o gobjnative/diff.o gobjnative/digraph.o gobjnative/edit.o gobjnative/eval.o gobjnative/evalfunc.o gobjnative/evalvars.o gobjnative/ex_cmds.o gobjnative/ex_cmds2.o gobjnative/ex_docmd.o gobjnative/ex_eval.o gobjnative/ex_getln.o gobjnative/fileio.o gobjnative/filepath.o gobjnative/findfile.o gobjnative/fold.o gobjnative/getchar.o gobjnative/hardcopy.o gobjnative/hashtab.o gobjnative/highlight.o gobjnative/indent.o gobjnative/insexpand.o gobjnative/json.o gobjnative/list.o gobjnative/main.o gobjnative/map.o gobjnative/mark.o gobjnative/memfile.o gobjnative/memline.o gobjnative/menu.o gobjnative/message.o gobjnative/misc1.o gobjnative/misc2.o gobjnative/move.o gobjnative/mbyte.o gobjnative/normal.o gobjnative/ops.o gobjnative/option.o gobjnative/os_mswin.o gobjnative/os_win32.o gobjnative/pathdef.o gobjnative/popupmnu.o gobjnative/popupwin.o gobjnative/profiler.o gobjnative/quickfix.o gobjnative/regexp.o gobjnative/scriptfile.o gobjnative/screen.o gobjnative/search.o gobjnative/session.o gobjnative/sha256.o gobjnative/sign.o gobjnative/spell.o gobjnative/spellfile.o gobjnative/syntax.o gobjnative/tag.o gobjnative/term.o gobjnative/testing.o gobjnative/textprop.o gobjnative/ui.o gobjnative/undo.o gobjnative/usercmd.o gobjnative/userfunc.o gobjnative/version.o gobjnative/viminfo.o gobjnative/winclip.o gobjnative/window.o gobjnative/os_w32exe.o gobjnative/vimrc.o gobjnative/xdiffi.o gobjnative/xemit.o gobjnative/xprepare.o gobjnative/xutils.o gobjnative/xhistogram.o gobjnative/xpatience.o gobjnative/gui.o gobjnative/gui_w32.o gobjnative/gui_beval.o -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion -lole32 -luuid D:/Users/John/Documents/software/MinGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.1/../../../../x86_64-w64-mingw32/bin/ld.exe: gobjnative/evalfunc.o:evalfunc.c:(.rdata+0x1e08): undefined reference to `f_cscope_connection'
collect2.exe: error: ld returned 1 exit status
make: *** [Make_cyg_ming.mak:1034: gvim.exe] Error 1
make: Leaving directory 'D:/Users/John/Documents/software/Utility/Vim/vim/vim/src'

</snip>

I have attached a patch, which might not be the right fix, but it works for me. :-)

Cheers

John

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/e2888ca7-fac7-9277-aed0-4930f9d6ba50%40internode.on.net.
--- evalfunc.c.orig     2019-09-07 04:34:15.596641800 +1000
+++ evalfunc.c  2019-09-07 04:34:42.058500600 +1000
@@ -436,7 +436,9 @@
     {"cosh",           1, 1, FEARG_1,    f_cosh},
 #endif
     {"count",          2, 4, FEARG_1,    f_count},
+#ifdef FEAT_CSCOPE
     {"cscope_connection",0,3, 0,         f_cscope_connection},
+#endif
     {"cursor",         1, 3, FEARG_1,    f_cursor},
 #ifdef MSWIN
     {"debugbreak",     1, 1, FEARG_1,    f_debugbreak},

Raspunde prin e-mail lui