This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I have Ubuntu 20.04, i am using GDNative in a project and i can compile for linux just fine but when i compile for windows and i have mingw installed as said in the doc it throw a g++ error "Command line option not found. Did you mean... so this is a compiler error i guess. So how to fix this ? Has anyone compiled for windows under linux please help me.

Godot version 3.23
in Engine by (28 points)

How exactly are you compiling? From IDE (which one?) from cli, with make, cmake, scons, whatever?
Did you test mingw compilation for other projects?

I have the same os and custom makefile. Everything works ok.

1 Answer

+1 vote

Use Docker. Containers used for official build can be found here.:
https://github.com/godotengine/build-containers

I edited the answer to update my script with registry name(this is new security requirement on some distros). If your module still does not build check your Sconstruruct file(one which you wrote for your module) for typos.

My personal interactive mega container for Win/JS/Android:

FROM docker.io/fedora:latest

RUN cd /root && \
echo 'fastestmirror=true' >> /etc/dnf/dnf.conf && \
dnf -y upgrade && \
dnf -y install scons mingw64-gcc-c++ mingw64-winpthreads-static \
     mingw32-gcc-c++ mingw32-winpthreads-static make binutils \
     yasm which xz lbzip2 java-1.8.0-openjdk-devel git unzip && \
dnf -y clean all && \
curl -O 'https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash' && \
echo '. ~/git-completion.bash' >> ./.bashrc && \
curl -O 'https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh' && \
echo '. ~/git-prompt.sh' >> ./.bashrc && \
echo 'export GIT_PS1_SHOWDIRTYSTATE=1' >> ./.bashrc && \
echo export PS1=\'\\w\$'(__git_ps1 " (%s)")'\\$ \' >> ./.bashrc && \
curl -LO 'https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip' && \
mkdir ./android && \
unzip ./commandlinetools-linux-6609375_latest.zip -d ./android/cmdline-tools && \
rm ./commandlinetools-linux-6609375_latest.zip && \
echo 'export ANDROID_HOME=~/android/' >> ./.profile && \
echo 'export ANDROID_NDK_ROOT=~/android/ndk-bundle/' >> ./.profile && \
echo 'export ANDROID_NDK_HOME=~/android/ndk-bundle/' >> ./.profile && \
mkdir ./.android && \
touch ./.android/repositories.cfg && \
yes | ./android/cmdline-tools/tools/bin/sdkmanager --licenses && \
./android/cmdline-tools/tools/bin/sdkmanager --install ndk-bundle && \
git clone https://github.com/emscripten-core/emsdk.git && \
./emsdk/emsdk install latest && \
./emsdk/emsdk activate latest && \
echo '. ~/emsdk/emsdk_env.sh' >> ./.bashrc && \
git clone https://github.com/godotengine/godot.git

CMD ["/bin/bash"]
by (887 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.