Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build on arch-linux #29

Open
FranciscoVasconcelos opened this issue Oct 3, 2022 · 3 comments
Open

Can't build on arch-linux #29

FranciscoVasconcelos opened this issue Oct 3, 2022 · 3 comments

Comments

@FranciscoVasconcelos
Copy link

I'm getting the following error while trying to build in arch-linux:

[  4%] Linking CXX shared library lib/libvsr_shared.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/vsr_shared.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC  -g -O3 -ftemplate-depth-1200 -Wno-switch -Wno-deprecated-declarations -Wno-int-to-pointer-cast -DVSR_PRECISION_DOUBLE -O2 -g -DNDEBUG -shared -Wl,-soname,libvsr_shared.so -o lib/libvsr_shared.so CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_cubicLattice.cpp.o CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_frame.cpp.o CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_op.cpp.o CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_round.cpp.o   -L/home/francisco/git-repos/versor/build/lib
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_frame.cpp.o:(.bss+0x0): multiple definition of `vsr::cga::pointsOnSphere'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_frame.cpp.o:(.bss+0x1): multiple definition of `vsr::cga::pointOnSphere'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x1): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_frame.cpp.o:(.bss+0x2): multiple definition of `vsr::cga::pairOnSphere'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x2): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_frame.cpp.o:(.bss+0x3): multiple definition of `vsr::cga::pointsOnCircle'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x3): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_frame.cpp.o:(.bss+0x4): multiple definition of `vsr::cga::pointOnCircle'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x4): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_frame.cpp.o:(.bss+0x5): multiple definition of `vsr::cga::pointOnLine'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x5): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_op.cpp.o:(.bss+0x0): multiple definition of `vsr::cga::pointsOnSphere'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x0): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_op.cpp.o:(.bss+0x1): multiple definition of `vsr::cga::pointOnSphere'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x1): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_op.cpp.o:(.bss+0x2): multiple definition of `vsr::cga::pairOnSphere'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x2): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_op.cpp.o:(.bss+0x3): multiple definition of `vsr::cga::pointsOnCircle'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x3): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_op.cpp.o:(.bss+0x4): multiple definition of `vsr::cga::pointOnCircle'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x4): first defined here
/usr/bin/ld: CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_op.cpp.o:(.bss+0x5): multiple definition of `vsr::cga::pointOnLine'; CMakeFiles/vsr_shared.dir/src/space/vsr_cga3D_external_linkage.cpp.o:(.bss+0x5): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/vsr_shared.dir/build.make:161: lib/libvsr_shared.so] Error 1
make[2]: Leaving directory '/home/francisco/git-repos/versor/build'
make[1]: *** [CMakeFiles/Makefile2:546: CMakeFiles/vsr_shared.dir/all] Error 2
make[1]: Leaving directory '/home/francisco/git-repos/versor/build'
make: *** [Makefile:146: all] Error 2
@StumpfMichael
Copy link

I have the same problem in Ubuntu 20.04.

Perhaps symbols from versor/include/vsr/space/vsr_cga3D_op.h are included several times.

@StumpfMichael
Copy link

Ok, in this h-file is a section with lamdas, defined with "auto" which has external linkage by default. To change it to local linkage just add "const" and you should be able to build the libraries. Example
auto pointsOnSphere ... => const auto pointsOnSphere ...

@Mgomez-01
Copy link

I just went through the same problem, and adding const to the declarations fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants