You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing build errors related to std::filesystem::__cxx11 on Raspbian Buster (gcc 8.3.0) when following https://www.libcinder.org/docs/guides/linux-notes/rpi3.html and getting to the "Building and Running BasicApp" steps. I've changed es2-rpi to es3-rpi (as my pull request does). Errors are along these lines:
/usr/bin/ld: /home/pi/Cinder/lib/linux/armv7l/es3-rpi/Debug/libcinder.a(Platform.cpp.o): in function `cinder::app::Platform::findAndAddDefaultAssetPath()':
/home/pi/Cinder/src/cinder/app/Platform.cpp:146: undefined reference to `std::filesystem::__cxx11::path::has_parent_path() const'
/usr/bin/ld: /home/pi/Cinder/src/cinder/app/Platform.cpp:146: undefined reference to `std::filesystem::__cxx11::path::parent_path() const'
/usr/bin/ld: /home/pi/Cinder/lib/linux/armv7l/es3-rpi/Debug/libcinder.a(Platform.cpp.o): in function `std::filesystem::__cxx11::path::path(std::filesystem::__cxx11::path&&)':
/usr/include/c++/8/bits/fs_path.h:171: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
I appear to be able to work around this by adding -std=c++11 -lstdc++fs to the linker line, but only if it is after libcinder.a. Right now, I'm using the following patch:
diff --git a/proj/cmake/modules/cinderMakeApp.cmake b/proj/cmake/modules/cinderMakeApp.cmake
index 5409dcb51..27a3c4280 100644
--- a/proj/cmake/modules/cinderMakeApp.cmake+++ b/proj/cmake/modules/cinderMakeApp.cmake@@ -108,6 +108,7 @@ function( ci_make_app )
unset( ARG_RESOURCES ) # Don't allow resources to be added to the executable on linux
endif()
+ set( CINDER_CXX_FLAGS "-std=c++11" )
elseif( CINDER_MSW )
if( MSVC )
# Override the default /MD with /MT
@@ -136,7 +137,7 @@ function( ci_make_app )
add_executable( ${ARG_APP_NAME} MACOSX_BUNDLE WIN32 ${ARG_SOURCES} ${ICON_PATH} ${ARG_RESOURCES} )
target_include_directories( ${ARG_APP_NAME} PUBLIC ${ARG_INCLUDES} )
- target_link_libraries( ${ARG_APP_NAME} cinder ${ARG_LIBRARIES} )+ target_link_libraries( ${ARG_APP_NAME} cinder "-lstdc++fs" ${ARG_LIBRARIES} )
if( MSVC )
# Ignore Specific Default Libraries for Debug build
but this is more a hack than a real fix.
The text was updated successfully, but these errors were encountered:
Unfortunately, filesystem support is experimental in gcc 8 and the symbols are not part of libstdc++ but libstdc++fs, which has to be explicitly linked. IIRC, starting with gcc9, filesystem is properly supported by gcc.
Not sure why it is necessary to compile with -std=c++11 however. With what standard was cinder itself compiled?
It's built as the same instructions say in the "Building Cinder" section (besides es2-rpi changed to es3-rpi there too). I see -std=c++17 in the compile line.
Now that you mention this, though, I tried removing -std=c++11 altogether and BasicApp is still building (so I must have mangled an earlier test while trying things). -lstdc++fs is still necessary and somewhere after libcinder.a.
I am seeing build errors related to
std::filesystem::__cxx11
on Raspbian Buster (gcc 8.3.0) when following https://www.libcinder.org/docs/guides/linux-notes/rpi3.html and getting to the "Building and Running BasicApp" steps. I've changedes2-rpi
toes3-rpi
(as my pull request does). Errors are along these lines:See attached file for full output: basicapp_raspbian.txt
I appear to be able to work around this by adding
-std=c++11 -lstdc++fs
to the linker line, but only if it is after libcinder.a. Right now, I'm using the following patch:but this is more a hack than a real fix.
The text was updated successfully, but these errors were encountered: