I am building static libraries with all USE variables (in cmake-gui) disabled and building all the modules except Visualization and Draw.
The build fails because of undefined reference errors when building the ExpToCasExe target (running make after having configured and generated with cmake-gui):
[100%] Linking CXX executable ../../lin64/gcc/bin/ExpToCasExe
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express.cxx.o): in function `Express::WriteFileStamp(std::ostream&)':
Express.cxx:(.text+0xb4): undefined reference to `OSD_Process::OSD_Process()'
/usr/bin/ld: Express.cxx:(.text+0xbc): undefined reference to `OSD_Process::SystemDate()'
/usr/bin/ld: Express.cxx:(.text+0xe5): undefined reference to `OSD_Environment::OSD_Environment(TCollection_AsciiString const&)'
/usr/bin/ld: Express.cxx:(.text+0xfd): undefined reference to `OSD_Environment::Value()'
/usr/bin/ld: Express.cxx:(.text+0x19f): undefined reference to `OSD_Process::UserName()'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Entity.cxx.o): in function `Express_Entity::writeIncludes(std::ostream&) const':
Express_Entity.cxx:(.text+0x1ebd): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0x1ec8): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Entity.cxx.o): in function `Express_Entity::GenerateClass() const':
Express_Entity.cxx:(.text+0x9b67): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0x9b72): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xb62e): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xb63e): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xc3b6): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Entity.cxx:(.text+0xc3d3): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Enum.cxx.o): in function `Express_Enum::GenerateClass() const':
Express_Enum.cxx:(.text+0x4f4): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Enum.cxx:(.text+0x4ff): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Select.cxx.o): in function `Express_Select::generateSelectMember(opencascade::handle<TColStd_HSequenceOfInteger> const&) const':
Express_Select.cxx:(.text+0x33c): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Select.cxx:(.text+0x347): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
/usr/bin/ld: ../../lin64/gcc/lib/libTKExpress.a(Express_Select.cxx.o): in function `Express_Select::GenerateClass() const':
Express_Select.cxx:(.text+0x193e): undefined reference to `OSD_Directory::OSD_Directory(OSD_Path const&)'
/usr/bin/ld: Express_Select.cxx:(.text+0x1949): undefined reference to `OSD_Directory::Build(OSD_Protection const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/ExpToCasExe/CMakeFiles/ExpToCasExe.dir/build.make:132: lin64/gcc/bin/ExpToCasExe-7.7.1] Error 1
make[1]: *** [CMakeFiles/Makefile2:2299: src/ExpToCasExe/CMakeFiles/ExpToCasExe.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
PS: I can see some symbols like OSD_Process are defined in libTKernel.a but maybe for some reason ExpToCasExe target does not link to it? Anyway I do NOT need this executable. Just all the .a files.
Discussion
7 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hello,
I am very sorry for your negative experience. I recommend you to change the file "occt/adm/MODULES" by removing the projects "TKExpress" and "ExpToCasExe" from "DataExchange".
In the 7.7.2 release we will fix this problem and put these projects in a separate module. This is in case you don't need these modules. They are external and our other projects do not depend on them. Otherwise, let me know and I'll fix the problem shortly.
But can you share a your gcc version for accurate reproduction.
I am testing it on this simple Dockerfile (ubuntu:latest gives me an lsb_release -a output of 22.04)
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
ENV DISPLAY=host.docker.internal:0.0
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y build-essential gdb valgrind git cmake cmake-gui
Edit: your suggestion worked. Thanks.
03Commenter-2
Hi, I am just noting that this is still an issue on 7.8.0 - I removed TKExpress from occt/adm/MODULES, but I cannot find DataExchange from where ExpToCasExehas to be removed. Could you specify further? Thanks.
Hello, on 7.8.0 dev you need to disable "BUILD_MODULE_DETools"
Best regards, Commenter-1.
05Commenter-3
I just had the same issue and found this comment very helpful. Note, though, that capitalization matters, and it's really how Dmitrii said: BUILD_MODULE_DEToolsnotBUILD_MODULE_DETOOLS.
06Commenter-1
I was trying on GCC and Clang and msvc with static build on latest master. Everything is build correct.
Could you share your CMake parameters or compiler version?
Best regards, Commenter-1.
07Commenter-1
My apologies about that issue. I will plan that for the ongoing release. Static build is crucial for webassem.
Additionally, I will check and option for case insensitive names.