Tutorial Step 10 POSITION_INDEPENDENT_CODE step

Greetings,

working through step 10 of tutorial and now at the last paragraph which starts “At this point, if you build everything …” and goes onto say there will be a link error if you try to build without doing what follows.

It says something about setting “the POSITION_INDEPENDENT_CODE target property of SqrtLibrary to be True when building shared libraries” and then provides the code to write below this. From what I can see here, It looks like you’re just supposed to add the line:

target_compile_definitions(MathFunctions PRIVATE “EXPORTING_MYMATH”)

below the line

target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)

in the CMakeLists.txt file in the MathFunctions subdirectory.

There’s nothing shown that explicitly sets the POSITION_INDEPENDENT_CODE target property of SqrtLibrary as far as I can see, this is very unclear first of all pedogogically. Second of all, it doesn’t seem to work anyway. I still get the same link error when I try to build namely:
“LINK : fatal error LNK1181: cannot open input file ‘Release\MathFunctions.lib’ [C:\Users\tdennis…”

Can someone explain what I’m missing and can someone make this step clearer? In particular, explain this business of POSITION_INDEPENDENT_CODE and how what is written is related to this?

@betsy.mcphail may be interested in following up on this query.