Comments (10)
That should work, you will have to use Clang++ outside of MinGW in order to be ABI compatible with the FastNoise2 libs. Alternatively you could compile FastNoise2 libs yourself for Clang on MinGW if you do want to go that route.
GCC MinGW is not supported: #69
from fastnoise2.
When using CMake with a single config generator like MinGW you need to specify -D CMAKE_BUILD_TYPE=Release at the CMake generate stage (before you build). Make sure you clear out the CMake generated build folder before switching compilers/configs
from fastnoise2.
Aaahhhh! There we go! For some reason the terrain is see-through (will have to figure that one out lol some other weird windows bug Im sure) but it does look to be generating now with the FastNoise2 noise on windows hah. Thanks so much for all the help Auburn!
Just for reference, I was able to build FastNoise fully like you suggested in the release mode with this command:
cmake -G "Ninja" -S . -B build -D FASTNOISE2_NOISETOOL=OFF -D FASTNOISE2_TESTS=OFF -D BUILD_SHARED_LIBS=ON -D CMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" -D CMAKE_C_COMPILER="C:/Program Files/LLVM/bin/clang.exe" -D CMAKE_BUILD_TYPE=Release
I realized that libFastNoise.dll error was because I was building my project with -o app
which built an app.exe with g++, but which only build an app file with clang++. So I was effectively running an old app.exe. After fixing that and rebuilding with the new DLLs it looks like it is working!
Before I close this, I wanted to ask if you would like me to create a pull request with this information on how to build for clang in the wiki. Thanks for all the help again!
from fastnoise2.
Thanks, I don't think you can PR stuff for the wiki, it's not part of the repo
from fastnoise2.
You should use either -lFastNoise or -lFastNoiseD (debug) not both. Your library link folder also looks wrong it should be -LC:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\library_windows
from fastnoise2.
Thank-you for the input! I have gotten rid of the debug file and fixed the link library folder so it only uses backslashes now, however I seem to still be getting the same undefined reference errors. I also tried forward slashes with no luck. Here is how the command looks now:
g++ -std=c++17 -fdiagnostics-color=always -g -IC:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\include -LC:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\library_windows C:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\library_windows\FastNoise.lib C:\Users\hilfu\Desktop\Code\minecraft-opengl\*.cpp C:\Users\hilfu\Desktop\Code\minecraft-opengl\glad.c -lglfw3dll -lFastNoise -o C:\Users\hilfu\Desktop\Code\minecraft-opengl\app
In case it may help I've also dropped here the full error stack as a txt file when running the command. Thank-you for your help.
full_undefined_error.txt
from fastnoise2.
I assume you are using minGW? I don't think MSVC compiled libs are compatible with MinGW
from fastnoise2.
It looks like g++ is mingw, I see that would not work then. I was mostly hoping it would because g++ worked with the MacOS clang binaries, but it seems Clang is different from ClangCL. If I switch my project to use ClangCL (with the clang++ command) that should work with the binaries highlighted below then, right? If not I was thinking maybe I should try to port my code over to visual studio since the wiki example uses that and MSVC is used by Visual Studio from what I can tell
from fastnoise2.
Thanks for the suggestion to compile on MinGW! It looks like it worked, I have some other errors in my code but I don't seem to be getting any undefined reference errors anymore, once I get my program fully working shortly and fix these seemingly unrelated errors I'll confirm it definitely worked.
I actually tried to compile the source before using the wiki, but I only noticed now by default it was compiling for Visual Studio (and thus likely for MSVC)! I used this command so it uses the GCC and G++ compilers/MinGW, and was able to get it to work for the project setup portion:
cmake -G "MinGW Makefiles" -S . -B build -D FASTNOISE2_NOISETOOL=OFF -D FASTNOISE2_TESTS=OFF -D BUILD_SHARED_LIBS=ON -D CMAKE_CXX_COMPILER="C:/Users/hilfu/Documents/mingw64/bin/g++.exe" -D CMAKE_C_COMPILER="C:/Users/hilfu/Documents/mingw64/bin/gcc.exe"
It may be useful to add a note to this wiki page (linked here) that you'll need to add -G "MinGW MakeFiles
and the extra options for the CMAKE_CXX_COMPILER
and CMAKE_C_COMPILER
to compile it for mingw.
Thanks for your help again!
from fastnoise2.
Ah, unfortunately I misread and you are right - I got no linker errors compiling with g++ but the program crashes when ran with any FastNoise2 command that actually generates noise.
I have since tried using clang++ instead with the LLVM toolchain, and get no linker errors, but for some reason instead get this error when running program:
However, when compiling with clang I don't even get a libFastNoise.dll (image of resulting build files below) so not sure where that is coming from.
Here is also the updated command I am running to make my executable:
clang++ -std=c++17 -fdiagnostics-color=always -g -IC:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\include -LC:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\library_windows C:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\library_windows\glfw3dll.lib C:\Users\hilfu\Desktop\Code\minecraft-opengl\dependencies\library_windows\FastNoiseD.lib C:\Users\hilfu\Desktop\Code\minecraft-opengl\*.cpp C:\Users\hilfu\Desktop\Code\minecraft-opengl\glad.c -lglfw3dll -lFastNoiseD -o C:\Users\hilfu\Desktop\Code\minecraft-opengl\app
On another note, for some reason when I compile the FastNoise2 source with clang I cannot get the release version only the debug version but I don't think that should matter. I might need to mess around with this a bit more to see if I can get this to work.
from fastnoise2.
Related Issues (20)
- GenUniformGrid2D only returning 0. HOT 3
- PositionOutput repeating on GenUniformGrid2D HOT 3
- OpenSimplex2 4th Dimension HOT 3
- View zoom in Node Editor HOT 3
- Where to put ImGui when building noisetool HOT 2
- CMake with MSVC setup for debug mode HOT 2
- Compile on macOS ARM doesn't produce binary HOT 2
- GenUniformGrid2D scaled xstart and ystart
- Is there C bindings? HOT 4
- Could there be a way to get both the value and the gradient? HOT 2
- What do I use the voxel tool for? HOT 1
- Could there or is there a way to get the maximum and minimum possible returned value for a node tree HOT 1
- Does library has 1D noise? HOT 1
- DistanceToPoint NaN at (0,0) HOT 2
- API Documentation / best place to search for in source code HOT 1
- [Question] What's the range of the example cave generation nodes tree? HOT 6
- FastNoise2 asserts without RTTI HOT 19
- FastNoise2 is taking more time to generate a 2D grid than FastNoiseLite HOT 2
- Crash when using c# bindings HOT 4
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 fastnoise2.