libSDL2main.a(SDLwindowsmain.c.obj):(.text+0x9c): undefined reference to `SDL_strlen'
- User
libSDL2main.a(SDL_windows_main.c.obj):(.text+0x9c): undefined reference to `SDL_strlen'
- Assistant
This error means that the linker was unable to find a reference to the function "SDL_strlen" in the static library file "libSDL2main.a".
One possible solution is to ensure that you have linked against the appropriate libraries and include directories needed by SDL2, as well as the standard library for C/C++.
You may also need to ensure that you have included the appropriate headers and source files for SDL2 in your project.
If the issue persists, you may need to recompile SDL2 and ensure that the "SDL_strlen" function is included in the library file.
- User
msys2 ucrt/lib mingw64/lib 区别是什么
- Assistant
msys2is a software distribution and development platform typically used on Windows systems, which provides a Unix-like environment and a package management system.ucrt/libis the directory in the Microsoft Visual Studio installation, which contains the Universal C Runtime (UCRT) library files.mingw64/libis the directory containing the library files for the 64-bit MinGW-w64 compiler toolchain. MinGW-w64 is a free, open-source software development environment for creating native Windows applications.Therefore, the primary difference between these directories is that
ucrt/libcontains Microsoft Visual C++ libraries, whilemingw64/libcontains MinGW-w64 libraries. - User
export PATH=$PATH:/mingw64/bin/ 具体意思
- Assistant
export PATH=$PATH:/mingw64/bin/is a command in Linux, macOS, or other Unix-like operating systems which adds the/mingw64/bin/directory to your environment'sPATHvariable.PATHis a system environment variable that contains a list of directories separated by the colon:character. When you run a command in the terminal, the system looks for that command in all the directories listed in thePATHvariable.The command
exportis used to set the environment variables and make them available to other processes and commands in the shell.So, with the command
export PATH=$PATH:/mingw64/bin/, you are adding the/mingw64/bin/directory to thePATHvariable, allowing you to run any executable files located in that directory from anywhere in the terminal. - User
是否只是临时有效? 当关闭终端后再打开, 是不是就无效了
- Assistant
是的,这个变量设置只是在当前终端窗口中有效。当你关闭终端后再打开,所有的环境变量都被重置为默认值。如果你希望每次打开终端时都能保留这个变量设置,你可以将这个命令添加到一个配置文件中,例如
~/.bashrc或~/.bash_profile文件,这样每次打开终端时都会自动加载这些配置。