Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when compiling #181

Open
JohnnyTheOne opened this issue Mar 5, 2021 · 6 comments · May be fixed by #189
Open

Error message when compiling #181

JohnnyTheOne opened this issue Mar 5, 2021 · 6 comments · May be fixed by #189

Comments

@JohnnyTheOne
Copy link

when compiling I get this error
C:\Users\JOHNNY~1\AppData\Local\Temp\ccD3D8hQ.ltrans0.ltrans.o: In function tmc2130_rx':

sketch/tmc2130.c:320: undefined reference to `tmc2130_cs_low'

sketch/tmc2130.c:321: undefined reference to `spi_txrx'

sketch/tmc2130.c:322: undefined reference to `spi_txrx'

sketch/tmc2130.c:323: undefined reference to `spi_txrx'

sketch/tmc2130.c:324: undefined reference to `spi_txrx'

sketch/tmc2130.c:325: undefined reference to `spi_txrx'

sketch/tmc2130.c:326: undefined reference to `tmc2130_cs_high'

sketch/tmc2130.c:330: undefined reference to `tmc2130_cs_low'

sketch/tmc2130.c:331: undefined reference to `spi_txrx'

sketch/tmc2130.c:333: undefined reference to `spi_txrx'

sketch/tmc2130.c:334: undefined reference to `spi_txrx'

sketch/tmc2130.c:335: undefined reference to `spi_txrx'

sketch/tmc2130.c:336: undefined reference to `spi_txrx'

sketch/tmc2130.c:337: undefined reference to `tmc2130_cs_high'

C:\Users\JOHNNY~1\AppData\Local\Temp\ccD3D8hQ.ltrans0.ltrans.o: In function `tmc2130_tx':

sketch/tmc2130.c:306: undefined reference to `tmc2130_cs_low'

sketch/tmc2130.c:307: undefined reference to `spi_txrx'

sketch/tmc2130.c:308: undefined reference to `spi_txrx'

sketch/tmc2130.c:309: undefined reference to `spi_txrx'

sketch/tmc2130.c:310: undefined reference to `spi_txrx'

sketch/tmc2130.c:311: undefined reference to `spi_txrx'

sketch/tmc2130.c:312: undefined reference to `tmc2130_cs_high'

C:\Users\JOHNNY~1\AppData\Local\Temp\ccD3D8hQ.ltrans0.ltrans.o: In function `tmc2130_init_axis_current_normal':

sketch/tmc2130.c:218: undefined reference to `__res'

C:\Users\JOHNNY~1\AppData\Local\Temp\ccD3D8hQ.ltrans0.ltrans.o: In function `tmc2130_init_axis_current_stealth':

sketch/tmc2130.c:205: undefined reference to `__res'

C:\Users\JOHNNY~1\AppData\Local\Temp\ccD3D8hQ.ltrans0.ltrans.o: In function `tmc2130_init':

sketch/tmc2130.c:247: undefined reference to `selector_step_pin_init'

sketch/tmc2130.c:248: undefined reference to `pulley_step_pin_init'

sketch/tmc2130.c:249: undefined reference to `idler_step_pin_init'

sketch/tmc2130.c:250: undefined reference to `selector_step_pin_reset'

sketch/tmc2130.c:251: undefined reference to `pulley_step_pin_reset'

sketch/tmc2130.c:252: undefined reference to `idler_step_pin_reset'

collect2.exe: error: ld returned 1 exit status

exit status 1
Fout bij het compileren voor board Original Prusa i3 MK3 Multi Material 2.0 upgrade
`

@rmilyard
Copy link

I am getting same now. You even get it fixed?

@JohnnyTheOne
Copy link
Author

Yes here

@rmilyard
Copy link

Yes here

Thanks. However I am not sure how to use this to fix it.

@JohnnyTheOne
Copy link
Author

Flashing procedure MMU2S here

MM-control-01.ino.prusa_mm_control.zip

@rmilyard
Copy link

Flashing procedure MMU2S here

MM-control-01.ino.prusa_mm_control.zip

Thanks. However trying to figure out how to compile it on my end. Some changes I am needing to make.

@Alia5
Copy link

Alia5 commented Aug 9, 2021

CMakeLists.txt L63: Change MM-control-01/tmc2130.c -> MM-control-01/tmc2130.cpp
Rename tmc2130.cpp -> tmc2130.c
#187

@Alia5 Alia5 mentioned this issue Aug 9, 2021
zavorka pushed a commit to zavorka/MM-control-01 that referenced this issue Oct 25, 2021
As the 'inline' designation is merely a hint for a compiler, an inline
function might likely actually end up being compiled on its own, in
which case, the linkage specifiers become significant. Therefore, one
has to be prepared for such eventuality: you can either declare the
function 'static' and have it be compiled in each translation unit
separately, or redeclare it with 'extern' in one translation unit.
Another option is to inline it forcefully with `always_inline`
attribute. Either way, it has to be dealt with.

Note: the `inline` keyword behaves differently in C++ than in C99/C11.

Fixes prusa3d#181, prusa3d#185
@zavorka zavorka linked a pull request Oct 25, 2021 that will close this issue
zavorka pushed a commit to zavorka/MM-control-01 that referenced this issue Oct 25, 2021
As the 'inline' designation is merely a hint for a compiler, an inline
function might likely actually end up being compiled on its own, in
which case, the linkage specifiers become significant. Therefore, one
has to be prepared for such eventuality: you can either declare the
function 'static' and have it be compiled in each translation unit
separately, or redeclare it with 'extern' in one translation unit.
Another option is to inline it forcefully with `always_inline`
attribute. Either way, it has to be dealt with.

Note: the `inline` keyword behaves differently in C++ than in C99/C11.

Fixes prusa3d#181, prusa3d#185
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants