Compilation of seafile-server 'make' command fails due to undefined reference

Hello everyone,

I’m trying to build the community seafile server on my ubuntu 18.04.
I’m following this manual download. seafile .com/published/seafile-manual/build_seafile/, and the building of libsearpc and ccnet-server
work fine, but I get several ‘undefined reference’ errors when trying to run the ‘make’
command for the seafile-server (see picture below):
In 5 files, there is an undefined reference to ‘seaf_branch_manager_test_and_update_branch’.

I have very little C knowledge, but I tried to check whether the header files and such were correctly referenced, but I couldn’t find anything wrong there…

I’ve downloaded several versions (7.1.0, 7.1.1, 7.1.5), but all have that problem…
(I have tried to simply ignore it (and even commented out the references), but the building steps afterwards never worked then…)

I’d be very thankful if somebody could help me out! :slight_smile:

Kind Regards!

Hi @pieper1000 you can check the compilation script for raspberry pi (ARM arch.). You have to delete some specific ARM/rpi lines, but basically, the compilation is the same. Check the comments inline the script regarding of ccnet & seafile. The packaging version is not consistent to seafile-server.

What I don’t really catch is why you are compiling. Is not good enough the seafile version from The matrix show that Bionic is still supported.

Hey @jobenvil, thank you for your quick reply!
I already got the community version running, but as I’m trying to learn more about web development I feel like taking on this challenge! :smiley:

I’ve followed the steps of the rpi guide. The building also produced errors, but created the zipped source files.

Since I wasn’t sure what to do with that new set of directories, or how this extra version can solve my issues with my other version, I replaced the ‘common’ and ‘server’ directories of my failing setup with the the ‘common’ and ‘server’ directories of these newly created directories.

Now I’m getting following error for the same ‘make’ command of seafile-server (see picture below):
It can’t find any CCNET_CFLAGS@ files…

Would you know why my first problem (from the original post) shows up nowhere else? Why am only I getting this error? Am I doing something wrong? Do I need to ‘officially’ copy this repository with some git account, so these references to some …branch_master… work?

Appreciative of any help over here! :smiley:

Kind Regards!

:point_right: You have to export PKG_CONFIG_PATH for seafile-server, libsearpc and ccnet-server like pointed out in the build script:

Thank you @jobenvil!

I have included following step now:

For my original error:
I’ve run the 3 commands before following the build procedure of the manuals:

export PKG_CONFIG_PATH=~/servers/humbold-dev/seafile-server/src/ccnet-server-7.1.5-server:$PKG_CONFIG_PATH

export PKG_CONFIG_PATH=~/servers/humbold-dev/seafile-server/src/seafile-server-7.1.5-server/lib:$PKG_CONFIG_PATH

export PKG_CONFIG_PATH=~/servers/humbold-dev/seafile-server/src/libsearpc-3.2-latest:$PKG_CONFIG_PATH

And I get the same error as in my original post.

And for the second error, using the ‘common’ and ‘server’ directories of the rpi version,
I’ve executed the same export PKG_CONFIG_PATH commands (with the corresponding paths of course), but I still get the same error…

(I’ve also executed an export PKG_CONFIG_PATH command for the ‘common’ and ‘server’ directories that the files are in from the first error, and also verified the presence of these paths in echo $PKG_CONFIG_PATH)

Maybe it would be helpful to point out that this error really only comes up for seafile-server, and not ccnet-server or libsearpc, suggesting to me that there is something wrong in the seafile-server setup…

P.S.: When running the ./ command, I often got following error message (see screenshot below):
‘subdir-objects’ is disabled. To solve that, I included the line AUTOMAKE_OPTIONS = subdir-objects at the top of every mentioned in the logs… Is that correct? Or should the execution in subdirectories not be enabled?

Kind Regards!

No issues. Post step by step what you have done. I cannot get at which point you get the errors.

@jobenvil thank you very much for your quick and continuous support!

So, all in all I’ve only been following the manual I’ve referenced before, and this error is happening in the ‘Building’ part of the manual, at the seafile-server step.

Two circumstances that might be noteworthy:

  1. I’ve executed the ‘’, ‘make’ and ‘make install’ several times so far, for several versions of libsearpc/ccnet-server/seafile-server, and I really don’t know whether that might be screwing with the repetition of the step
  2. I’ve included the AUTOMAKE_OPTIONS = subdir-objects line at the top of every that was brought up by the logs because of disabled subdirectory execution. Maybe that was wrong?

As the error is happening during a gcc command within the make command of the seafile-server directory, I have been able to reproduce the error with the same gcc command, while being in the seafile-server/server directory though. Below is the command that produces the same error:

sudo gcc -DPKGDATADIR=\"/usr/local/share/seafile\" -DPACKAGE_DATA_DIR=\"/usr/local/share/seafile\" -DSEAFILE_SERVER -DFULL_FEATURE -I../include -I../lib -I../lib -I../common -pthread -I/usr/local/include -I/usr/local/include/searpc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/local/include -I/usr/local/include/searpc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/mysql -Wall -g -O2 -o seaf-server seaf-server.o web-accesstoken-mgr.o seafile-session.o zip-download-mgr.o index-blocks-mgr.o share-mgr.o passwd-mgr.o quota-mgr.o repo-op.o repo-perm.o size-sched.o virtual-repo.o copy-mgr.o http-server.o upload-file.o access-file.o pack-dir.o fileserver-config.o ../common/seaf-db.o ../common/branch-mgr.o ../common/fs-mgr.o ../common/config-mgr.o repo-mgr.o ../common/commit-mgr.o ../common/log.o ../common/object-list.o ../common/rpc-service.o ../common/vc-common.o ../common/seaf-utils.o ../common/obj-store.o ../common/obj-backend-fs.o ../common/seafile-crypt.o ../common/diff-simple.o ../common/mq-mgr.o ../common/block-mgr.o ../common/block-backend.o ../common/block-backend-fs.o ../common/merge-new.o ../common/block-tx-utils.o -L/usr/local/lib /usr/local/lib/ ../lib/.libs/libseafile_common.a -levhtp ../common/cdc/.libs/libcdc.a -lssl -lcrypto -luuid -levent -lpthread /usr/local/lib/ -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ljansson -lz -larchive -lmysqlclient /usr/lib/x86_64-linux-gnu/ -pthread

Its ‘gcc’, then some directories and then many binaries that were created during steps before.
When searching the files for the string ‘seaf_branch_manager_test_and_update_branch’ I found out that its defined in branch_mgr.c, and referenced in the files that are listed in the error.
Additionally, I have also noticed that all the other files have a ‘matching binary’ with an .o extension, for example:

/home/jerome/servers/humbold-dev/seafile-server/src/seafile-server-7.1.5-server/server/repo-mgr.c: if (seaf_branch_manager_test_and_update_branch (seaf->branch_mgr,
Binary file /home/jerome/servers/humbold-dev/seafile-server/src/seafile-server-7.1.5-server/server/repo-mgr.o matches

But the branch-mgr.c file doesn’t have a ‘matching binary’:
/home/jerome/servers/humbold-dev/seafile-server/src/seafile-server-7.1.5-server/common/branch-mgr.c:seaf_branch_manager_test_and_update_branch (SeafBranchManager *mgr,

As of now, my understanding would be that something with the generation of the binary file branch-mgr.o is failing (the file branch-mgr.o does get produced though), and then the linking through libtool doesn’t work…
I have close to no experience with make, makefiles, gcc, or C in general, so I’d be very grateful if you/somebody has an idea on how to debug this?

I really don’t know what else to do…maybe im missing some dependencies/requirements?

Kind Regards

One thing in advance, forget the build manual for x64! This is not up-to-date and its like a puzzle with missing pieces and other pieces which doesn’t belong to.

Check the compilation for raspberry pi. Although the page looks like weird, the concept is best explained and you get the whole picture there. Take really care with the python requirements, they don’t apply anymore. I have adapted them a little bit to get compiled 7.1.5.

Basically the steps to compile are here:

Don’t hesitate to ask again and don’t give up.