eMail icon indicating copy to clipboard operation
eMail copied to clipboard

compiler error - opensuse

Open ant0sha opened this issue 1 year ago • 0 comments

lot of things like this during linking step:

/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: remotesmtp.o:/dare/sys_libs_experimental/eMail/include/email.h:81: multiple definition of `Mopts'; email.o:/dare/sys_libs_experimental/eMail/src/email.c:45: first defined here

Following patch fixes it for me:

commit 3ccc3f0fe865d7c7c4be1779116e98f8476d50da
Author: Anton Sharonov <[email protected]>
Date:   Thu Mar 16 10:45:13 2023 +0100

    Make eMail compilable

diff --git a/include/email.h b/include/email.h
index 5800265..7a73533 100644
--- a/include/email.h
+++ b/include/email.h
@@ -61,8 +61,8 @@ typedef enum { GPG_SIG=0x01, GPG_ENC=0x02 } GpgCallType;
 
 
 /* Globally defined vars */
-dhash table;
-char *conf_file;
+extern dhash table;
+extern char *conf_file;
 
 struct mailer_options {
 	bool verbose;
@@ -78,7 +78,9 @@ struct mailer_options {
 	dlist to;
 	dlist cc;
 	dlist bcc;
-} Mopts;
+} ;
+
+extern struct mailer_options Mopts;
 
 void usage(void);
 
diff --git a/src/email.c b/src/email.c
index 524e9be..1966648 100644
--- a/src/email.c
+++ b/src/email.c
@@ -40,6 +40,10 @@
 #include "error.h"
 #include "mimeutils.h"
 
+dhash table;
+char *conf_file;
+struct mailer_options Mopts;
+
 static void
 defaultDestr(void *ptr)
 {

ant0sha avatar Mar 16 '23 09:03 ant0sha