pog5 / minecraft-freebsd

A guide on how to setup Prism Launcher and Minecraft on FreeBSD.
MIT License
17 stars 4 forks source link

Fails to build on FreeBSD 14.0 #8

Open justdie386 opened 11 months ago

justdie386 commented 11 months ago

[  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 commented 11 months ago

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

justdie386 commented 11 months ago

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

magicalskye commented 11 months ago

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 commented 11 months ago

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

Gamer100Dev commented 10 months ago

Any fixes?

Gamer100Dev commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 9 months ago

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 commented 7 months ago

@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

VVD commented 2 months ago

Use games/lwjgl3 from ports.