visual c++ - c++ floating point code and shared objects -


a while put cross-platform, single source windows dll/linux wanted call application used floats. got variety of errors related dll/so boiled down -- if program using dll/so contains floats, must dll/so. found defining float in dll/so source noot enough, had assign value float. sufficient compilers, vc++ , g++, make lib floating point support. ever since tuck float pi = 3.1415; shared object code, in case.

so, question is: there better way this? g++ loves shine unused variables breaks "treat warnings errors" (i'd turn off too).

i suppose other question intrinsic topic "why problem exist , why solution work?"

windows , linux answers, please, if differ. don't remember os spat out warnings.


here note inserted in code 5 years ago. tried add in comment below. it's mite mangled there.

//************************************************************ //  no, have no use pi in library.  however, //  defined here compiler include floating //  point code.  way, calling programs can use floating //  point.  if assignment done on declaration //  generate "unused variable" warning. //************************************************************ 

the unused variable warning sounds bit g++/gcc loves pour out unused-but-set warnings.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -