#106 failing to build with arch linux

Closed
opened 5 years ago by micdac · 2 comments
micdac commented 5 years ago

Hi, first of all, I am quite inexperienced using cmake. I am currently trying to compile the studio, but failing at step 3, the morph library. First I tried to the build_all.sh, here it failed to find the 2geom library. I moved 2geom.pc from /usr/local/share/pkgconfig to /usr/share/pkgconfig (and also fmt.pc), which seemed to solve that issue. Now I had a fmt linking error. I did the following manipulation:

diff --git a/geom_helpers/CMakeLists.txt b/geom_helpers/CMakeLists.txt
index fc09c13..92911ed 100644
--- a/geom_helpers/CMakeLists.txt
+++ b/geom_helpers/CMakeLists.txt
@@ -10,7 +10,8 @@ target_include_directories(geom_helpers
     SYSTEM BEFORE PUBLIC
         ${LIB2GEOM_INCLUDE_DIRS}
 )
-target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} fmt)
+#target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} fmt)
+target_link_libraries(geom_helpers /usr/local/lib64/libfmt.so)

basically hardcoded the fmt library path. The compilation seems to progress a bit further but fails with the following:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/dacko/projects/cpp/rainynite_manual/rainy-morph
[ 28%] Built target geom_helpers
[ 38%] Built target morphing
[ 42%] Linking CXX executable test_morph
/usr/bin/ld: ../geom_helpers/libgeom_helpers.so: undefined reference to `Geom::BezierCurveN<1u>::intersect(Geom::Curve const&, double) const'
/usr/bin/ld: ../geom_helpers/libgeom_helpers.so: undefined reference to `Geom::Curve::allNearestTimes(Geom::Point const&, double, double) const'
/usr/bin/ld: ../geom_helpers/libgeom_helpers.so: undefined reference to `Geom::PathSink::feed(Geom::Circle const&)'

and so on. Probably it somewhere a beginner mistake, but I would appreciate some help :) Best Michael

Hi, first of all, I am quite inexperienced using cmake. I am currently trying to compile the studio, but failing at step 3, the morph library. First I tried to the build_all.sh, here it failed to find the 2geom library. I moved 2geom.pc from /usr/local/share/pkgconfig to /usr/share/pkgconfig (and also fmt.pc), which seemed to solve that issue. Now I had a fmt linking error. I did the following manipulation: ``` diff --git a/geom_helpers/CMakeLists.txt b/geom_helpers/CMakeLists.txt index fc09c13..92911ed 100644 --- a/geom_helpers/CMakeLists.txt +++ b/geom_helpers/CMakeLists.txt @@ -10,7 +10,8 @@ target_include_directories(geom_helpers SYSTEM BEFORE PUBLIC ${LIB2GEOM_INCLUDE_DIRS} ) -target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} fmt) +#target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} fmt) +target_link_libraries(geom_helpers /usr/local/lib64/libfmt.so) ``` basically hardcoded the fmt library path. The compilation seems to progress a bit further but fails with the following: ``` -- Configuring done -- Generating done -- Build files have been written to: /home/dacko/projects/cpp/rainynite_manual/rainy-morph [ 28%] Built target geom_helpers [ 38%] Built target morphing [ 42%] Linking CXX executable test_morph /usr/bin/ld: ../geom_helpers/libgeom_helpers.so: undefined reference to `Geom::BezierCurveN<1u>::intersect(Geom::Curve const&, double) const' /usr/bin/ld: ../geom_helpers/libgeom_helpers.so: undefined reference to `Geom::Curve::allNearestTimes(Geom::Point const&, double, double) const' /usr/bin/ld: ../geom_helpers/libgeom_helpers.so: undefined reference to `Geom::PathSink::feed(Geom::Circle const&)' ``` and so on. Probably it somewhere a beginner mistake, but I would appreciate some help :) Best Michael
caryoscelus commented 5 years ago
Owner

Hi,

I moved 2geom.pc from /usr/local/share/pkgconfig to /usr/share/pkgconfig (and also fmt.pc), which seemed to solve that issue

Instead of doing that, it should be possible to add "/usr/local" to some environment variable (apparently PKG_CONFIG_PATH)

-target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} fmt) +target_link_libraries(geom_helpers /usr/local/lib64/libfmt.so)

Original line links with two libs, but you've hardcoded just one, so perhaps adding lib2geom path would help..

That said, i'm not sure it's worth building. I'm no longer working on c++ version and while a lot of it works it's quite tricky to use.

Hi, > I moved 2geom.pc from /usr/local/share/pkgconfig to /usr/share/pkgconfig (and also fmt.pc), which seemed to solve that issue Instead of doing that, it should be possible to add "/usr/local" to some environment variable (apparently PKG_CONFIG_PATH) > -target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} fmt) > +target_link_libraries(geom_helpers /usr/local/lib64/libfmt.so) Original line links with two libs, but you've hardcoded just one, so perhaps adding lib2geom path would help.. That said, i'm not sure it's worth building. I'm no longer working on c++ version and while a lot of it works it's quite tricky to use.
micdac commented 5 years ago
Poster

thanks, I was stupid, now it works:

+target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} /usr/local/lib64/libfmt.so)

That said, i'm not sure it's worth building. I'm no longer working on c++ version and while a lot of it works it's quite tricky to use.

I kind of suspected it, but still curious to try. thanks again.

thanks, I was stupid, now it works: ``` +target_link_libraries(geom_helpers ${LIB2GEOM_LIBRARIES} /usr/local/lib64/libfmt.so) ``` > That said, i'm not sure it's worth building. I'm no longer working on c++ version and while a lot of it works it's quite tricky to use. I kind of suspected it, but still curious to try. thanks again.
Sign in to join this conversation.
Loading...
Cancel
Save
There is no content yet.