Comments (3)
Here's what I've done.
Generate object file
$ clang++ \
-c src/main.cxx \
-o 3d-game-shaders-for-beginners.o \
-std=gnu++11 \
-g \
-O2 \
-I/Library/Developer/Panda3D/include
Generate binary
$ clang++ \
3d-game-shaders-for-beginners.o \
-o 3d-game-shaders-for-beginners \
-L/Library/Developer/Panda3D/lib \
-lp3framework \
-lpanda \
-lpandafx \
-lpandaexpress \
-lpandaphysics \
-lp3dtoolconfig \
-lp3dtool \
-lpthread
List dylibs linked to binary
$ otool -L 3d-game-shaders-for-beginners
3d-game-shaders-for-beginners:
@loader_path/../lib/libp3framework.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
@loader_path/../lib/libpanda.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
@loader_path/../lib/libpandafx.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
@loader_path/../lib/libpandaexpress.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
@loader_path/../lib/libpandaphysics.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
@loader_path/../lib/libp3dtoolconfig.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
@loader_path/../lib/libp3dtool.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
As you can see in the output above, all panda-related libraries were marked as a directory above and in a lib dir, which doesn't exist.
We could either copy the dylibs to that directory or fix the paths. I chose to fix them.
Fix linked libraries paths
install_name_tool -change '@loader_path/../lib/libp3framework.1.10.dylib' /Library/Developer/Panda3D/lib/libp3framework.1.10.dylib 3d-game-shaders-for-beginners
install_name_tool -change '@loader_path/../lib/libpanda.1.10.dylib' /Library/Developer/Panda3D/lib/libpanda.1.10.dylib 3d-game-shaders-for-beginners
install_name_tool -change '@loader_path/../lib/libpandafx.1.10.dylib' /Library/Developer/Panda3D/lib/libpandafx.1.10.dylib 3d-game-shaders-for-beginners
install_name_tool -change '@loader_path/../lib/libpandaexpress.1.10.dylib' /Library/Developer/Panda3D/lib/libpandaexpress.1.10.dylib 3d-game-shaders-for-beginners
install_name_tool -change '@loader_path/../lib/libpandaphysics.1.10.dylib' /Library/Developer/Panda3D/lib/libpandaphysics.1.10.dylib 3d-game-shaders-for-beginners
install_name_tool -change '@loader_path/../lib/libp3toolconfig.1.10.dylib' /Library/Developer/Panda3D/lib/libp3toolconfig.1.10.dylib 3d-game-shaders-for-beginners
install_name_tool -change @loader_path/../lib/libp3dtoolconfig.1.10.dylib /Library/Developer/Panda3D/lib/libp3dtoolconfig.1.10.dylib 3d-game-shaders-for-beginners
install_name_tool -change @loader_path/../lib/libp3dtool.1.10.dylib /Library/Developer/Panda3D/lib/libp3dtool.1.10.dylib 3d-game-shaders-for-beginners
Result
$ otool -L 3d-game-shaders-for-beginners
3d-game-shaders-for-beginners:
/Library/Developer/Panda3D/lib/libp3framework.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/Library/Developer/Panda3D/lib/libpanda.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/Library/Developer/Panda3D/lib/libpandafx.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/Library/Developer/Panda3D/lib/libpandaexpress.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/Library/Developer/Panda3D/lib/libpandaphysics.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/Library/Developer/Panda3D/lib/libp3dtoolconfig.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/Library/Developer/Panda3D/lib/libp3dtool.1.10.dylib (compatibility version 1.10.0, current version 1.10.9)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)
from 3d-game-shaders-for-beginners.
this is not a compile error, it is a runtime error.
one simple way is to add pand3d to the dyld search path, you can run like this:
DYLD_LIBRARY_PATH=/Library/Developer/Panda3D/lib ./3d-game-shaders-for-beginners
from 3d-game-shaders-for-beginners.
Hey @dandingol03 can you post more details of how you compiled your program (i.e., which commands you used)?
It seems like your binary has the incorrect library path encoded in it, so the loader can't find the panda dylib when you try to run.
Can you try to run the command below to list the libraries linked with your binary?
otool -L 3d-game-shaders-for-beginners
After that, you can use a tool called install_name_tool
to fix the path yourself:
install_name_tool -change <path to libp3framework returned by otool> <correct path to libp3framework> 3d-game-shaders-for-beginners
from 3d-game-shaders-for-beginners.
Related Issues (20)
- Could I get the project file of the model? Like a blender project. HOT 2
- Shader version 150 not supported on MacOS HOT 6
- Need help in how to build on Windows HOT 3
- crash when load_font, windows 10, vs2017, debug x64 HOT 1
- sRGB Formula incorrect
- :display:gsg:glgsg(warning): Project runs but shaders do not load correctly HOT 9
- Windows, can't load shaders! HOT 4
- can't find p3pystub HOT 2
- Get Linkers for panda HOT 4
- Can't open the final package HOT 1
- Demo crash on M1 macbook HOT 5
- Crash on Manjaro KDE HOT 1
- compile error on win10 HOT 1
- Windows10 - Run Demo with 100% GPU usage?
- How to run on Windows visual studio 2019 since panda3d isnt supported on mingw g++ HOT 2
- How to configure builds for Windows users HOT 5
- Demo run crash, Intel iris, Ubuntu 20.04
- .
- No textures when running on MacOS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 3d-game-shaders-for-beginners.