Skip to content

Build lib Files with gcc on Windows #6753

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
14 changes: 4 additions & 10 deletions .github/workflows/test_suite_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,15 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Visual Studio 10 and OpenJDK 18
- name: Install OpenJDK 18
shell: powershell
run: |
choco install -y openjdk --version=18.0.2
choco install -y visualcpp-build-tools
run: choco install -y openjdk --version=18.0.2
- name: Install Webots Compilation Dependencies
run: |
export PYTHON_INSTALLATION_FOLDER=/C/hostedtoolcache/windows/Python
export PYTHON_HOME=$PYTHON_INSTALLATION_FOLDER/3.11.`ls $PYTHON_INSTALLATION_FOLDER | grep '^3\.11\.[0-9]\+$' | cut -c6- | sort -n | tail -n1`/x64
echo 'export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK`' >> ~/.bash_profile
echo 'export PYTHON_HOME='$PYTHON_HOME >> ~/.bash_profile
echo 'export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017"' >> ~/.bash_profile
echo 'export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6"' >> ~/.bash_profile
echo 'export PATH=$PYTHON_HOME:$PYTHON_HOME/Scripts:$GITHUB_WORKSPACE/msys64/mingw64/bin:$GITHUB_WORKSPACE/bin/node:/mingw64/bin:/usr/bin:$JAVA_HOME/bin:$PATH' >> ~/.bash_profile
export WEBOTS_HOME=$GITHUB_WORKSPACE
Expand Down Expand Up @@ -110,18 +107,15 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
update: false
- name: Install Visual Studio 10 and OpenJDK 18
- name: Install OpenJDK 18
shell: powershell
run: |
choco install -y openjdk --version=18.0.2
choco install -y visualcpp-build-tools
run: choco install -y openjdk --version=18.0.2
- name: Install Webots Compilation Dependencies
run: |
export PYTHON_INSTALLATION_FOLDER=/C/hostedtoolcache/windows/Python
export PYTHON_HOME=$PYTHON_INSTALLATION_FOLDER/3.11.`ls $PYTHON_INSTALLATION_FOLDER | grep '^3\.11\.[0-9]\+$' | cut -c6- | sort -n | tail -n1`/x64
echo 'export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK`' >> ~/.bash_profile
echo 'export PYTHON_HOME='$PYTHON_HOME >> ~/.bash_profile
echo 'export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017"' >> ~/.bash_profile
echo 'export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6"' >> ~/.bash_profile
echo 'export PATH=$PYTHON_HOME:$PYTHON_HOME/Scripts:$GITHUB_WORKSPACE/msys64/mingw64/bin:$GITHUB_WORKSPACE/bin/node:/mingw64/bin:/usr/bin:$JAVA_HOME/bin:$PATH' >> ~/.bash_profile
export WEBOTS_HOME=$GITHUB_WORKSPACE
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test_suite_windows_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,15 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Visual Studio 10 and OpenJDK 18
- name: Install OpenJDK 18
shell: powershell
run: |
choco install -y openjdk --version=18.0.2
choco install -y visualcpp-build-tools
run: choco install -y openjdk --version=18.0.2
- name: Install Webots Compilation Dependencies
run: |
export PYTHON_INSTALLATION_FOLDER=/C/hostedtoolcache/windows/Python
export PYTHON_HOME=$PYTHON_INSTALLATION_FOLDER/3.11.`ls $PYTHON_INSTALLATION_FOLDER | grep '^3\.11\.[0-9]\+$' | cut -c6- | sort -n | tail -n1`/x64
echo 'export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK`' >> ~/.bash_profile
echo 'export PYTHON_HOME='$PYTHON_HOME >> ~/.bash_profile
echo 'export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017"' >> ~/.bash_profile
echo 'export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6"' >> ~/.bash_profile
echo 'export PATH=$PYTHON_HOME:$PYTHON_HOME/Scripts:$GITHUB_WORKSPACE/msys64/mingw64/bin:$GITHUB_WORKSPACE/bin/node:/mingw64/bin:/usr/bin:$JAVA_HOME/bin:$PATH' >> ~/.bash_profile
export WEBOTS_HOME=$GITHUB_WORKSPACE
Expand Down
9 changes: 8 additions & 1 deletion docs/reference/changelog-r2025.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Webots R2025 Change Log

## Webots R2025b.
- Enhancements
- Added missing import libraries on Windows ([#6753](https://github.com/cyberbotics/webots/pull/6753)).
- Added some missing function definitions to the existing Windows libraries ([#6753](https://github.com/cyberbotics/webots/pull/6753)).
- Cleanup
- **Removed `libController.a` and `libCppController.a` libraries on Windows. Please use `Controller.lib` and `CppController.lib` instead ([#6753](https://github.com/cyberbotics/webots/pull/6753)).**

## Webots R2025a
Released on January 31st, 2025.
- New Features
Expand All @@ -24,7 +31,7 @@ Released on January 31st, 2025.
- Improved the image range of the rotating [Lidar](lidar.md) ([#6324](https://github.com/cyberbotics/webots/pull/6324)).
- Show box-plane contact point normals when showing contact points ([#6678](https://github.com/cyberbotics/webots/pull/6678)).
- Improved the speed and accuracy of box-plane collisions ([#6688](https://github.com/cyberbotics/webots/pull/6688)).
- Enabled the launching of MATLAB desktop from the extern launcher ([#6366](https://github.com/cyberbotics/webots/pull/6366)).
- Enabled the launching of MATLAB desktop from the extern launcher ([#6366](https://github.com/cyberbotics/webots/pull/6366)).
- Improved overlays visible in Overlays menu by adding all the robots in the menu list ([#6297](https://github.com/cyberbotics/webots/pull/6297)).
- Cleanup
- Removed deprecated `windowPosition`, `pixelSize` fields of [Display](display.md) node ([#6327](https://github.com/cyberbotics/webots/pull/6327)).
Expand Down
28 changes: 0 additions & 28 deletions projects/default/libraries/vehicle/c/car/car.def

This file was deleted.

30 changes: 0 additions & 30 deletions projects/default/libraries/vehicle/c/driver/driver.def

This file was deleted.

This file was deleted.

39 changes: 1 addition & 38 deletions resources/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -391,18 +391,6 @@ ifdef BUILD_STATIC_LIBRARY
STATIC_LINK_FLAGS += rvs
endif

# Visual Studio
ifeq ($(OSTYPE),windows)
ifdef BUILD_SHARED_LIBRARY
ifndef USE_CXX
ifneq ($(wildcard /C/Program\ Files\ */Microsoft\ Visual\ Studio/2017),)
VISUAL_STUDIO_PATH?=/C/Program Files (x86)/Microsoft Visual Studio/2017
endif
VS_DEF_NAME = $(NAME).def
endif
endif
endif

ifeq ($(OSTYPE),darwin)
ifdef WEBOTS_LIBRARY
INSTALL_NAME ?= @rpath/Contents/lib/controller/$(MAIN_TARGET)
Expand Down Expand Up @@ -486,6 +474,7 @@ MAIN_TARGET_COPY ?= $(MAIN_TARGET)
MAIN_TARGET_WINDOWS64_LIB = $(MAIN_TARGET:.dll=.lib)
endif
ifeq ($(OSTYPE),windows)
DYNAMIC_LINK_FLAGS += -Wl,--out-implib,$(MAIN_TARGET_WINDOWS64_LIB)
FILES_TO_REMOVE += $(MAIN_TARGET_WINDOWS64_LIB)
endif

Expand All @@ -506,19 +495,6 @@ endif
ifdef TARGET_LIB_DIR

$(MAIN_TARGET): $(TARGET_LIB_DIR)/$(MAIN_TARGET)
ifdef VS_DEF_NAME
@# Generate the .lib libraries to facilitate the integration with Visual Studio
@# if the .def file is existing.
@if [ -f $(VS_DEF_NAME) ]; then \
if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \
PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \
mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \
rm -f *.exp; \
else \
$(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \
fi \
fi
endif

else

Expand All @@ -528,19 +504,6 @@ $(MAIN_TARGET): $(BUILD_GOAL_DIR)/$(MAIN_TARGET)
@# This new version will be executed only when the process restarts.
@# Note: this binary may be an executable (e.g., a controller) or shared library (e.g., a physics plug-in).
@rm -f $(MAIN_TARGET) > /dev/null 2>&1 && echo "# copying to" $(MAIN_TARGET_COPY) && cp $(BUILD_GOAL_DIR)/$(MAIN_TARGET) $(MAIN_TARGET_COPY) > /dev/null 2>&1
ifdef VS_DEF_NAME
@# Generate the .lib libraries to facilitate the integration with Visual Studio
@# if the .def file is existing.
@if [ -f $(VS_DEF_NAME) ]; then \
if [ -d "$(VISUAL_STUDIO_PATH)" ]; then \
PATH="$(VISUAL_STUDIO_PATH)/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64":$PATH lib /machine:X64 /def:$(VS_DEF_NAME) /out:out.lib > /dev/null; \
mv out.lib $(MAIN_TARGET_WINDOWS64_LIB); \
rm -f *.exp; \
else \
$(ECHO) "\033[0;33m'VISUAL_STUDIO_PATH' environmental variable not set or Microsoft Visual Studio not installed, skipping $(NAME).lib\033[0m"; \
fi \
fi
endif

endif

Expand Down
1 change: 0 additions & 1 deletion scripts/install/bash_profile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# export PYTHON_HOME="C:\Program Files\Python310" # Optionally defines the path to Python home.
# export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK` # Optionally defines the path to Java home.
# export MATLAB_HOME=/C/Program\ Files/MATLAB/R2018b # Optionally defines the path to MATLAB home.
# export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017" # Optionally defines the path to Microsoft Visual Studio home.
# export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6" # Optionally defines the path to Inno Setup home.


Expand Down
6 changes: 4 additions & 2 deletions scripts/packaging/files_core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ lib/controller/ [windows,linux]

lib/controller/Controller [dll,windows,linux]
lib/controller/Controller.lib [windows]
lib/controller/libController.a [windows]

lib/controller/CppController [dll,windows,linux]
lib/controller/libCppController.a [windows]
lib/controller/CppController.lib [windows]

lib/controller/java/ [windows,linux]
lib/controller/java/*.jar [windows,linux]
Expand All @@ -81,8 +80,11 @@ lib/controller/CppDriver [dll,windows,linux]
lib/controller/driver [dll,windows,linux]
lib/controller/car.lib [windows]
lib/controller/driver.lib [windows]
lib/controller/CppCar.lib [windows]
lib/controller/CppDriver.lib [windows]

lib/controller/generic_robot_window [dll,windows,linux]
lib/controller/generic_robot_window.lib [windows]

lib/controller/python/ [windows,linux]
lib/controller/python/controller/ [windows,linux]
Expand Down
Loading
Loading