Hi,

When compiling on Solaris using gcc 10, I am getting this error:

/usr/gcc/10/bin/gcc ... -o gvim ...
ld: fatal: symbol 'longVersion' is multiply-defined:
        (file objects/version.o type=OBJT; file objects/main.o type=OBJT);
collect2: error: ld returned 1 exit status
link.sh: Linking failed


I have produced pre-processed sources (gcc -E) and grepped them for
'longVersion' string:

main.E:void init_longVersion(void);
main.E: char *longVersion =                  <-------------------
main.E:    init_longVersion();
main.E:    mch_errmsg(longVersion);
main.E:    init_longVersion();
main.E:    mch_msg(longVersion);

version.E:void init_longVersion(void);
version.E:extern char *longVersion ;
version.E:char *longVersion = "VIM - Vi IMproved " "8" "." "2" " (" "2019 Dec 
12" ")";   <------
version.E:init_longVersion(void)
version.E:    init_longVersion();
version.E:    msg(longVersion);


Looking in the sources my feeling is that longVersion should be defined
in version.c and only declared (using 'extern') in main.c.

Looking into pre-processed main.c I can see:


 char *longVersion =
# 1336 "globals.h" 3 4
                        ((void *)0)


And looking at globals.h line 1336:

1335 #else
1336 EXTERN char *longVersion INIT(= NULL);
1337 #endif

If I replace that line with

extern char *longVersion;

I can compile vim just fine. This does not seem to be something solaris
specific, so I have feeling that I am missing something ...

Thanks for VIM!
-- 
        Vlad

-- 
-- 
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/20210918070113.wnkbxuw4sdusdoas%40virtual.cz.oracle.com.

Raspunde prin e-mail lui