shift_reg_out.c is compiled twice #5

Open
opened 2026-10-30 16:40:40 +01:00 by simon · 0 comments
Owner

src/ws2812_driver.c includes shift_reg_out.c, and CMakeLists.txt also compiles shift_reg_out.c as a separate translation unit. Thus shift_out_init() and shift_out_put() are defined in two objects.

The link succeeds only because the linker does not pull shift_reg_out.c.obj out of the static library: ws2812_driver.c.obj already defines all symbols. A shared library or a direct link of the objects fails.

Include the header and keep the separate translation unit, or remove shift_reg_out.c from the target.

`src/ws2812_driver.c` includes `shift_reg_out.c`, and `CMakeLists.txt` also compiles `shift_reg_out.c` as a separate translation unit. Thus `shift_out_init()` and `shift_out_put()` are defined in two objects. The link succeeds only because the linker does not pull `shift_reg_out.c.obj` out of the static library: `ws2812_driver.c.obj` already defines all symbols. A shared library or a direct link of the objects fails. Include the header and keep the separate translation unit, or remove `shift_reg_out.c` from the target.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
simon/rp2040_ws2812_driver#5
No description provided.