Giter Club home page Giter Club logo

allolib_playground's People

Contributors

adamschmieder avatar fishuyo avatar konhyong avatar kybr avatar mantaraya36 avatar myunginlee avatar pconrad avatar rajansaini691 avatar sihwapark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

allolib_playground's Issues

run.sh messaging if libsndfile is missing

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

flags.cmake linking static libraries

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?

Visual Studio 16 2019

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.