This is a free to use CLion DLL Example. Use it for litterly anything but give credits.
- Toolchain Configuration: Ensure your toolchain is set to Visual Studio. Without this, many standard library functions will not function as expected.
- Mappings:
If your project involves games like Minecraft, where mappings are necessary, use MCP Mapping Viewer. This project uses thestable_22
mappings. Make sure to apply the correct mappings for your specific use case to avoid errors. What are mappings?
Mappings translate obfuscated code or names (common in modding or reverse engineering) back into human-readable names. Applying the correct mappings helps you understand and modify the code more easily. - Using Windows-Specific Libraries:
If you want to use Windows API functions likePlaySoundA
, ensure yourCMakeLists.txt
includes the following line:target_link_libraries(Example PRIVATE winmm)
Using GCC/MinGW toolchains on Windows might limit support for certain C++ standard library features. These adjustments ensure compatibility.
- You can not use
std::cout << "Random text \n";
instead useprintf("Random text \n");
- Using Strings: Avoid using
std::string random;
. Instead, opt for:char* random;
- Although Visual Studio is popular, here are several reasons to consider CLion:
- Better Organization: CLion's project structure and interface are more intuitive, especially if you're familiar with other JetBrains products like IntelliJ IDEA.
- Superior Refactoring: CLion's refactoring tools are reliable and user-friendly, which is essential for maintaining clean code.
- Enhanced Functionality: CLion offers advanced coding tools, better CMake integration, and features like code analysis and navigation.
- Robust Package Management: CLion simplifies dependency management with a powerful package manager.
- Smaller Project Files: CLion’s project files are typically smaller and more manageable than those created by Visual Studio.
To get started with this project, you'll need to have the following installed:
- Universal Windows Platform development
- MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.38-17.8)
- MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)
- Windows 11 SDK (10.0.22621.0)
- C++ CMake tools for Windows
- IntelliCode
Once you have Clion and the parts above installed, go in Clion u might download some Plugins you know from IntelliJ because they may be on Clion also. Then go in the settings and add a new "Toolchain" under "Build, Execution, Deployment" click on the "+" then select "Visual Studio" and select your installation path. Then right under "Toolchains" is "CMake" and click twice on the "+" until "Debug" and "Release" shows up. Click on "Release" and make sure the "Toolchain" is selected to "Visual Studio"