Skip to content

Compilation error of Cython #372

Discussion options

You must be logged in to vote

This is Cython and not C so there are some subtle differences. If you see the error message, all your errors are with the printf statement you have added, and not with anything else. Try this:

printf("Elastic strain\n")

The problem is when you pass "%s" and the argument of "Elastic strain", in this case the second is a Python object (a string) and this cannot be passed as an argument directly to the C function printf. Since all you want is a string to be printed, just calling printf("string") will work. For other integer and number arguments the usual printf("%f\n", some_float) will work fine.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by JunBlairGeng
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@JunBlairGeng
Comment options

@JunBlairGeng
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants