allosphere-research-group / allolib_playground Goto Github PK
View Code? Open in Web Editor NEWCode playground for allolib
Code playground for allolib
Shouldn't be the case only app cpp file should get built if it has changed.
this is the main compiler for Windows. Note that the CMake generator for VS16 works a little differently than VS15 and earlier. See: "Use -A option to specify architecture."
cmake -G
CMake Error: No generator specified for -G
Generators
* Visual Studio 16 2019 = Generates Visual Studio 2019 project files.
Use -A option to specify architecture.
Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
Optional [arch] can be "Win64" or "IA64".
Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
Optional [arch] can be "Win64" or "IA64".
This compiler seems to build allolib fine:
cd allolib
mkdir build
cmake ..
cmake --build .
But, the run script does not work:
./run.sh allolib/examples/graphics/2D.cpp
Building for Visual Studio 15 2017
You must install Visual Studio 2017 to use allolib
+ 'C:/Program Files/CMake/bin/cmake.exe' -G 'Visual Studio 15 2017 Win64' -Wno-deprecated -DCMAKE_BUILD_TYPE=Release -DAL_APP_FILE=../../../2D.cpp -DAL_VERBOSE_OUTPUT=OFF /c/Users/ky/allolib_playground
CMake Error at CMakeLists.txt:3 (project):
Generator
Visual Studio 15 2017 Win64
I spent some time trying to get it to work, but I failed. I don't understand the cmake system well enough.
Was struggling with a linker error for hours when trying to run an allolib app via allolib_playground. This particular application used Gamma/SamplePlayer.
The error message was not helpful:
Undefined symbols for architecture x86_64:
"int gam::SoundFile::read<float>(float*, int)", referenced from:
int gam::SoundFile::readAllD<float>(float*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::seek(int, int)", referenced from:
int gam::SoundFile::readAllD<float>(float*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::close()", referenced from:
gam::SamplePlayer<float, gam::ipl::Cubic, gam::phsInc::Loop>::load(char const*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::openRead()", referenced from:
gam::SamplePlayer<float, gam::ipl::Cubic, gam::phsInc::Loop>::load(char const*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::SoundFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
gam::SamplePlayer<float, gam::ipl::Cubic, gam::phsInc::Loop>::load(char const*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::~SoundFile()", referenced from:
gam::SamplePlayer<float, gam::ipl::Cubic, gam::phsInc::Loop>::load(char const*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::frames() const", referenced from:
int gam::SoundFile::readAllD<float>(float*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::samples() const", referenced from:
gam::SamplePlayer<float, gam::ipl::Cubic, gam::phsInc::Loop>::load(char const*) in simple-fundamental-estimation.cpp.o
int gam::SoundFile::readAllD<float>(float*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::channels() const", referenced from:
gam::SamplePlayer<float, gam::ipl::Cubic, gam::phsInc::Loop>::load(char const*) in simple-fundamental-estimation.cpp.o
int gam::SoundFile::readAllD<float>(float*) in simple-fundamental-estimation.cpp.o
"gam::SoundFile::frameRate() const", referenced from:
gam::SamplePlayer<float, gam::ipl::Cubic, gam::phsInc::Loop>::load(char const*) in simple-fundamental-estimation.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [../../../bin/simple-fundamental-estimation] Error 1
make[2]: *** [CMakeFiles/simple-fundamental-estimation.dir/all] Error 2
make[1]: *** [CMakeFiles/simple-fundamental-estimation_run.dir/rule] Error 2
make: *** [simple-fundamental-estimation_run] Error 2
+ set +x
@kybr worked through some troubleshooting with me and eventually directed me to run brew install linbsndfile
This resolved the issue.
It would benefit allolib_playground newcomers such as myself if the run.sh script could detect if required software such as libsndfile
was missing from the system and provide a helpful error message to the user.
Thanks for your attention,
Philip
My flags.cmake:
set(AL_VERBOSE_OUTPUT 1)
set(app_include_dirs Foo/include)
set(app_link_libs ../../../Foo/libfoo.a)
set(app_linker_flags)
which tries to add a libfoo.a
to the link line results in this link line and error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/main.dir/XXXXX/use-foo/main.cpp.o -o ../../../bin/main ../../../../../allolib/build/Release/libal.a -l../../../Foo/libfoo.a ../../../../../allolib/build/al_ext/assets3d/libal_assets3d.a ../../../../../allolib/build/al_ext/openvr/libal_openvr.a ../../../../../allolib/build/al_ext/soundfile/libal_soundfile.a ../../../../../allolib/build/al_ext/spatialaudio/libal_spatialaudio.a ../../../../../allolib/build/al_ext/statedistribution/libal_statedistribution.a /usr/local/lib/libassimp.dylib /usr/local/lib/libfftw3f.dylib ../../../../../allolib/build/Release/libal.a -framework OpenGL ../../../../../allolib/build/Release/external/Gamma/lib/libGamma.a /usr/local/lib/libsndfile.dylib ../../../../../allolib/build/Release/external/glfw/src/libglfw3.a -framework Cocoa -framework IOKit -framework CoreVideo ../../../../../allolib/build/Release/external/glad/libglad.a -ldl ../../../../../allolib/build/Release/external/rtaudio/librtaudio.a -framework CoreAudio -framework CoreFoundation ../../../../../allolib/build/Release/external/rtmidi/librtmidi.a -ljack -framework CoreServices -framework CoreAudio -framework CoreMIDI -framework CoreFoundation ../../../../../allolib/build/Release/external/libimgui.a ../../../../../allolib/build/Release/external/liboscpack.a ../../../../../allolib/build/Release/external/libserial.a -framework Foundation -framework IOKit
ld: library not found for -l../../../Foo/libfoo.a
Exploding that for easy reading, we get this:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-O3
-DNDEBUG
-Wl,-search_paths_first
-Wl,-headerpad_max_install_names
CMakeFiles/main.dir/XXXXX/use-foo/main.cpp.o
-o ../../../bin/main
../../../../../allolib/build/Release/libal.a
-l../../../Foo/libfoo.a
../../../../../allolib/build/al_ext/assets3d/libal_assets3d.a
../../../../../allolib/build/al_ext/openvr/libal_openvr.a
../../../../../allolib/build/al_ext/soundfile/libal_soundfile.a
../../../../../allolib/build/al_ext/spatialaudio/libal_spatialaudio.a
../../../../../allolib/build/al_ext/statedistribution/libal_statedistribution.a
/usr/local/lib/libassimp.dylib
/usr/local/lib/libfftw3f.dylib
../../../../../allolib/build/Release/libal.a
-framework OpenGL
../../../../../allolib/build/Release/external/Gamma/lib/libGamma.a
/usr/local/lib/libsndfile.dylib
../../../../../allolib/build/Release/external/glfw/src/libglfw3.a
-framework Cocoa
-framework IOKit
-framework CoreVideo
../../../../../allolib/build/Release/external/glad/libglad.a
-ldl
../../../../../allolib/build/Release/external/rtaudio/librtaudio.a
-framework CoreAudio
-framework CoreFoundation
../../../../../allolib/build/Release/external/rtmidi/librtmidi.a
-ljack
-framework CoreServices
-framework CoreAudio
-framework CoreMIDI
-framework CoreFoundation
../../../../../allolib/build/Release/external/libimgui.a
../../../../../allolib/build/Release/external/liboscpack.a
../../../../../allolib/build/Release/external/libserial.a
-framework Foundation
-framework IOKit
And we see the problem: -l../../../Foo/libfoo.a
. We don't want the extra -l
in this case. What is the correct way to use this mechanism to link local static libs?
The include paths need to be updated to reflect the playground's new dependency structure.
From kybr
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.