Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build on FreeBSD 14.0 #8

Open
justdie386 opened this issue Dec 10, 2023 · 14 comments
Open

Fails to build on FreeBSD 14.0 #8

justdie386 opened this issue Dec 10, 2023 · 14 comments

Comments

@justdie386
Copy link

justdie386 commented Dec 10, 2023

[  0% 1/1] cd /home/justdie/Downloads/lwjgl3/work/lwjgl3-3.3.3 && /usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant all && /usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant release -Dbuild.offline=yes -Djavadoc.skip=yes
Buildfile: /home/justdie/Downloads/lwjgl3/work/lwjgl3-3.3.3/build.xml

init:

check-dependencies:

-compile-generator:

compile-templates:

generate:

compile:

compile-tests:

compile-native:

compile-native-platform:
 [Compiler] cc --version: "FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)"
 [Compiler] /home/justdie/Downloads/lwjgl3/work/lwjgl3-3.3.3/modules/lwjgl/tinyfd/src/main/c/tinyfiledialogs.c:3295:30: warning: call to undeclared function 'realpath'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 [Compiler]       lAllocatedCharString = realpath(lBuff,NULL); /*same as canonicalize_file_name*/
 [Compiler]                              ^
 [Compiler] /home/justdie/Downloads/lwjgl3/work/lwjgl3-3.3.3/modules/lwjgl/tinyfd/src/main/c/tinyfiledialogs.c:3295:28: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
 [Compiler]       lAllocatedCharString = realpath(lBuff,NULL); /*same as canonicalize_file_name*/
 [Compiler]                            ^ ~~~~~~~~~~~~~~~~~~~~
 [Compiler] 1 warning and 1 error generated.
FAILED: CMakeFiles/lwjgl3 /home/justdie/Downloads/lwjgl3/work/.build/CMakeFiles/lwjgl3 
cd /home/justdie/Downloads/lwjgl3/work/lwjgl3-3.3.3 && /usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant all && /usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant release -Dbuild.offline=yes -Djavadoc.skip=yes
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /home/justdie/Downloads/lwjgl3```
@pog5
Copy link
Owner

pog5 commented Dec 19, 2023

Try disabling the warning-to-error conversion for that specific warning

@justdie386
Copy link
Author

Im rather unsure how to do that... I don't have much experience tweaking compilers

@magicalskye
Copy link

yeah i’ve been trying to figure out how to disable this goddamn error for the past 2 hours and at this point i think it’s probably faster to fix the code than to deal with cmake

@justdie386
Copy link
Author

No idea, but hit me up if you figure it out

@Gamer100Dev
Copy link

Any fixes?

@Gamer100Dev
Copy link

Gamer100Dev commented Jan 13, 2024

I think I found a fix, we need somebody to go onto a vm, compile it on 13.2 FreeBSD, and then upload a precompiled version of lwjgl3, and then we need put the libraries contents into the correct directories for Minecraft to load.

@justdie386
Copy link
Author

There used to be a precompiled version on this repo but recently the creator changed it all and it’s gone, the precompiled used to work perfectly for me

@justdie386
Copy link
Author

If we go into older versions of the repo we could find it but I’m not on FreeBSD for now so I’m not gonna bother

@Gamer100Dev
Copy link

I fixed it, do you want a compilied version with the jars and libs that you can copy and paste into those paths, that the owner told us to check, when our build was completed? It works for me, FreeBSD 14.0. Let me know

@Gamer100Dev
Copy link

Gamer100Dev commented Jan 13, 2024

I used this repo:
https://github.com/LWJGL/lwjgl3
And then I copied the cmake file from the current repo into that repo, I then used the cd command to the second repo, and used the following command:
/usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant all && /usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant release -Dbuild.offline=yes -Djavadoc.skip=yes
Then I made two files on my desktop:
Jars -- Inlcuding all the jars in the Release which was in the bin folder (in the repo I used to compile lwjgl3), then I did a search for .jars and copied and pasted all of them there
Libs -- I went into the repo I made my build, and typed .so and copied all of the files to the libs folder
Second Step:
For our jars I cd-ed to the directory and did this command:
sudo cp -r * /usr/local/share/java/classes/lwjgl3
For our libs I went into the directory and did this:
sudo cp -r * /usr/local/lib/lwjgl3
Then I used my Minecraft launcher, and it worked!
Hope this helps you out.

@pog5
Copy link
Owner

pog5 commented Jan 14, 2024

There used to be a precompiled version on this repo but recently the creator changed it all and it’s gone, the precompiled used to work perfectly for me

I added a link to a older commit of the repo to the README file, try using that one instead

@vareille
Copy link

vareille commented Feb 11, 2024

I've just corrected this missing function realpath() compilation error on freebsd in tinyfiledialogs v3.17.4
Please update your version of LWJGL with latest tinyfiledialogs from
https://sourceforge.net/projects/tinyfiledialogs

@e34rrsff
Copy link

e34rrsff commented Apr 2, 2024

@Gamer100Dev's solution worked for me.

Yes, I'm on FreeBSD 14.0 RELEASE

To be clearer, git clone https://github.com/LWGJL/lwjgl3.

/usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant all && /usr/local/bin/cmake -E env JAVACMD=/usr/local/openjdk17/bin/java JAVA8_HOME=/usr/local/openjdk8 ant release -Dbuild.offline=yes -Djavadoc.skip=yes

  • Run: # mkdir /usr/local/share/java/classes/lwjgl3 /usr/local/lib/lwjgl3

  • Run: # find /PATH/TO/GIT/lwjgl3 -name "*.so" -exec cp {} /usr/local/lib/lwjgl3/ \;

  • Run: find /PATH/TO/GIT/lwjgl3 -name "*.jar" -exec cp {} /usr/local/share/java/classes/lwjgl3/ \;

  • Install minecraft-client & openjdk17-jre:
    # pkg install minecraft-client openjdk17-jre

  • Overwrite the original minecraft-runtime file with the one from the extracted tar:
    # cp /PATH/TO/EXTRACTED/TAR/lwjgl3/minecraft-runtime /usr/loca/share/minecraft-client/minecraft-runtime

  • In PrismLauncher, go to Settings > Java and set "Java Path" to:
    /usr/local/share/minecraft-client/minecraft-runtime

@VVD
Copy link

VVD commented Sep 11, 2024

Use games/lwjgl3 from ports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants