tostercx/ssocks

make fails

Opened this issue · 1 comments

[ 20%] Built target ssocks
[ 21%] Linking C executable ssocksd
/usr/bin/ld: CMakeFiles/ssocksd.dir/src/configd-util.c.o:(.bss+0x0): multiple definition of `globalArgsServer'; CMakeFiles/ssocksd.dir/src/ssocksd.c.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ssocksd.dir/build.make:289: ssocksd] Error 1
make[1]: *** [CMakeFiles/Makefile2:117: CMakeFiles/ssocksd.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Modified 3 files

configd-util.h

struct globalArgsServer_t {
char fileauth[255]; // -a option
char fileconfig[255]; // -f option
char filelog[255]; // -l option
char bindAddr[16]; // -b option
unsigned int port; // -p option
unsigned int verbosity; // -v option
unsigned int daemon; // -d option
unsigned int ssl; // -s option
#ifdef HAVE_LIBSSL
char filecert[255]; // -c option
char filekey[255]; // -k option
#endif
unsigned int guest;
char **inputFiles; // input files
int numInputFiles; // # of input files

//} globalArgsServer;
};

configd-util.c

I defined "globalArgsServer" in the source, rather than in the head file.

struct globalArgsServer_t globalArgsServer;

ssocks.c

extern struct globalArgsServer_t globalArgsServer;

Make failure is due solely to my file name changes.
Before running "make" command, .c files have been renamed as .cpp and the source files are compiled by C++.
This is why make failed.

The file names above are not correct. They are corrected as follows;

configd-util.c -->configd-util.cpp
ssocks.c --> ssocks.cpp