
























































































































Rust Visual C++ prerequisites
Rust requires a linker and Windows API libraries but they don't seem to be
available.
These components can be acquired through a Visual Studio installer.




rustup-init.exe built for the x86_64-pc-windows-msvc target. In general, this is the build of rustup one should install on Windows. This will require the Visual C++ Build Tools 2019 or equivalent (Visual Studio 2019, etc.) to already be installed. If you would prefer to install GNU toolchains or the i686 toolchains by default this can be modified at install time, either interactively, with the --default-host flag, or after installation via rustup set default-host.






[0/255] Generating debug/libddnet_engine_shared.a
Updating crates.io index
Downloaded cc v1.0.73
Downloaded link-cplusplus v1.0.6
Downloaded cxx v1.0.71
Downloaded proc-macro2 v1.0.40
Downloaded quote v1.0.20
Downloaded syn v1.0.98
Downloaded cxxbridge-flags v1.0.71
Downloaded unicode-ident v1.0.1
Downloaded cxxbridge-macro v1.0.71
Downloaded 9 crates (664.7 KB) in 2.64s
Compiling cc v1.0.73
Compiling proc-macro2 v1.0.40
Compiling quote v1.0.20
Compiling unicode-ident v1.0.1
Compiling syn v1.0.98
Compiling cxxbridge-flags v1.0.71
Compiling ddnet-engine-shared v0.0.1 (E:\Teeworlds_DDNet\ddnet\src\engine\shared)
Compiling ddnet-test v0.0.1 (E:\Teeworlds_DDNet\ddnet\src\rust-bridge\test)
Compiling link-cplusplus v1.0.6
Compiling cxx v1.0.71
Compiling cxxbridge-macro v1.0.71
Compiling ddnet-base v0.0.1 (E:\Teeworlds_DDNet\ddnet\src\base)
Compiling ddnet-engine v0.0.1 (E:\Teeworlds_DDNet\ddnet\src\engine)
Finished dev [unoptimized + debuginfo] target(s) in 2m 20s

$ CXXFLAGS="-fdiagnostics-color=always" CFLAGS="-fdiagnostics-color=always" cmake -G Ninja -DDEV=ON -DPREFER_BUNDLED_LIBS=ON -DIPO=OFF -DAUTOUPDATE=OFF -DDOWNLOAD_GTEST=ON ..
$ time ninja
## with rust
real 1m47,277s
## 16.5
real 1m26,152s


use teeint::UnPackTwInt;
let buff = [0b1000_0000, 0b0000_0001];
let result = buff.as_slice().unpack().unwrap();
assert_eq!(result, 64);







































Using Statics or Consts
It can be confusing whether or not you should use a constant item or a static item. Constants should, in general, be preferred over statics unless one of the following are true:
Large amounts of data are being stored
The single-address property of statics is required.
Interior mutability is required.


Using Statics or Consts
It can be confusing whether or not you should use a constant item or a static item. Constants should, in general, be preferred over statics unless one of the following are true:
Large amounts of data are being stored
The single-address property of statics is required.
Interior mutability is required. 



import twmap
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import twmap
File "C:\Python38\lib\site-packages\twmap\__init__.py", line 1, in <module>
from .twmap import *
ImportError: DLL load failed while importing twmap: La procédure spécifiée est introuvable.











The single-address property of statics help?




The single-address property of statics help? 












































































vim "$(fzf)" alias for that















file at twmap.pyd?

twmap.pyd: PE32+ executable (DLL) (console) x86-64 (stripped to external PDB), for MS Windows









target-feature=+crt-static (edited)





C:/Windows/System32 instead of C:/Windows/system32











[NOT_FOUND] gdiplus.dll :








CC=clang CXX=clang++ CXXFLAGS=-fPIC CFLAGS=-fPIC cmake .. -DHEADLESS_CLIENT=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPREFER_BUNDLED_LIBS=ON











































cmake .. -DCMAKE_CXX_FLAGS="-fno-pic" -DCMAKE_C_FLAGS="-fno-pic" -DCMAKE_LINKER_FLAGS="-fno-pie"



#!/bin/bash
cmake .. -DCMAKE_CXX_FLAGS="-fno-pic" -DCMAKE_C_FLAGS="-fno-pic" -DCMAKE_LINKER_FLAGS="-fno-pie"


CXXFLAGS="..." LDFLAGS="..." CFLAGS="..." cmake ...














libtwmap.dll to twmap.dll and place it into the directory where you want to import it

/home/chiller/Desktop/git/ddnet/src/engine/gfx/image_loader.cpp:241: error: undefined reference to 'png_read_image'
Compiling twmap v0.9.0





libtwmap.dll to twmap.dll and place it into the directory where you want to import it 




.pyd









twmap directory in site-packages and put the dll there

twmap.pyd and import it in that directory?


twmap.pyd and import it in that directory? 







--strip to have a similar file size

At global scope: cc1plus.exe: note: unrecognized command-line option '-Wno-nullability-completeness' may have been intended to silence earlier diagnostics
I get this warning whenever the compiler prints another error or warning.
Shouldn't this warning be prevented by using add_cxx_compiler_flag_if_supported in CMakeLists?
-Wno- flags

a113a03 Add tests for overloaded hash operators, use operator instead - Robyt3
ab42651 Add test for the CSemaphore wrapper - Robyt3
dab6bbf Add more tests for str_utf8_comp_confusable - Robyt3
0bf31c6 Add tests for str_utf8_to_skeleton - Robyt3
7c63d3c Remove internal utf8 confusable functions from system.h - Robyt3
bc4a5ee Merge #6033 - bors[bot]
mingw-w64-gcc after that I tried to run cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/mingw64.toolchain .. inside a build4w folder. But it returns You must install Curl/SQLite3/libpng/Freetype/Ogg/Opus/Opusfile/SDL2/Vulkan libraries to compile the DDNet client. Should do I specify that I only want to compile the server via -DCLIENT=OFF?
git submodule update --init --recursive
CMake Error in CMakeLists.txt:
IMPORTED_IMPLIB not set for imported target "GTest::gtest" configuration
"Release".

CMake Error in CMakeLists.txt:
IMPORTED_IMPLIB not set for imported target "GTest::gtest" configuration
"Release". -DCMAKE_DISABLE_FIND_PACKAGE_GTest=ON


CMake Error in CMakeLists.txt:
IMPORTED_IMPLIB not set for imported target "GTest::gtest" configuration
"Release". 

