Using CMake: Static and Dynamic Libraries

Using CMake: Static and Dynamic Libraries

When compiling a new program, we will use third-party compiled library files or library files that we compiled ourselves. Here we will use the static and dynamic libraries that have been compiled previously.1. Using Static LibrariesThe file structure is as follows. Here we have deleted add.c and subtract.c from the src folder, keeping only main.c, … Read more

Common Syntax of CMake (Strings)

Common Syntax of CMake (Strings)

Previous Highlights:CMake Hello, WorldCMake VariablesCMake Official Tutorial (Basic Project Setup)CMake Official Tutorial (Library Creation)CMake Official Tutorial (Usage Requirements)CMake Official Tutorial (Installation and Testing)CMake Common Syntax (if Statements)CMake Common Syntax (Cache Variables)CMake Common Syntax (Environment Variables)CMake Common Syntax (Mathematical Calculations) In mainstream programming languages, strings are a fundamental and core data type, which is crucial, and … Read more

Different Linking Methods for CMake Libraries

Different Linking Methods for CMake Libraries

1. Different Libraries Have Different Linking Methods OpenCV uses ${OpenCV_LIBS} target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS}) protobuf uses ${PROTOBUF_LIBRARIES} target_link_libraries(${PROJECT_NAME} ${PROTOBUF_LIBRARIES}) jpeg-turbo uses the target name libjpeg-turbo::turbojpeg-static target_link_libraries(${PROJECT_NAME} libjpeg-turbo::turbojpeg-static) 2. How to Determine Which Method to Use Generally, the following methods can be used: Check the CMake file for usage instructions. (Well-written CMake files usually include usage instructions) Look … Read more

Documenting a Crash Issue Caused by Missing Return in High Version GCC

Documenting a Crash Issue Caused by Missing Return in High Version GCC

1. Problem Phenomenon The code that runs normally on CentOS 7 crashes when compiled and run on CentOS 8. 2. Troubleshooting Process The crash occurred at a location in the test case that should not have been reached, so I first commented out that part of the code. It then crashed again after reaching the … Read more

Academician Gao Wen, Chairman of GCC SAC: Building a National Highway for AI Computing Power to Make It as Convenient as Electricity

Academician Gao Wen, Chairman of GCC SAC: Building a National Highway for AI Computing Power to Make It as Convenient as Electricity

Gao Wen, a representative of the National People’s Congress, an academician of the Chinese Academy of Engineering, and the director of the Pengcheng National Laboratory, mentioned in an interview that the construction of the computing power network includes three core elements: large-scale core computing power, super optical networks, and computing power scheduling systems. The ideal … Read more

GCC 15 Compiler Nears Completion: COBOL and Itanium Join, ALGOL Exits

GCC 15 Compiler Nears Completion: COBOL and Itanium Join, ALGOL Exits

Introduction: The 15th version of the GNU Compiler Collection is set to be released, during which some changes will be locked. GCC (GNU Compiler Collection) 15 is being updated as planned, and a new front end for COBOL is being introduced. This upgrade will also bring significant improvements to the development of C and C++. … Read more

Linux | GCC Compilation Guide

Linux | GCC Compilation Guide

01 Why learn embedded Linux and embedded microcontrollers? Because AI will not be able to replace them in the next decade. GCC, which stands for GNU Compiler Collection, is a compilation suite that supports various computer architectures such as X86, ARM, and MIPI. The GCC that we use is included by default in Ubuntu.GCC options … Read more

Keil MDK Upgraded to V5.42a, Fixing This Bug

Keil MDK Upgraded to V5.42a, Fixing This Bug

Recently, Keil MDK has been significantly upgraded to version V5.42, but for users in China (using the Chinese version of the Windows operating system), the first step in installation encountered difficulties, as shown in the image below: Of course, I was no exception, as I got stuck during installation (encountering a bug), and I even … Read more

Unable to Use Serial Port After Driver Installation, Device Manager Error (Code 52)

Unable to Use Serial Port After Driver Installation, Device Manager Error (Code 52)

Moxa’s serial port devices, such as serial port servers, serial port cards, and USB-to-serial devices, require driver installation to function properly. Sometimes, after installing the driver, issues may arise where the device cannot be used normally. In Device Manager, the device driver shows a yellow exclamation mark, indicating that Windows cannot verify the digital signature … Read more

Introduction to the Platform Device Driver Model

Introduction to the Platform Device Driver Model

In the Linux kernel, the <span>platform</span> device driver model is used to manage devices that are not directly mounted on physical buses (such as PCI or USB), for example, hardware modules (such as GPIO controllers, timers, etc.) within a System on Chip (SoC). This model associates devices (<span>platform_device</span>) and drivers (<span>platform_driver</span>) through a virtual <span>platform_bus_type</span> … Read more