visual studio - How to avoid for c++ compiler optimizer to remove static variable code? -


i use c++ in ms visual studio c++ 2013 sp5. know, google test(gtest) initialize test codes static variables. when put these gtest codes (.cpp) in main project, there no problem. but, when move these gtest codes (.cpp) library project main project depends, gtest don't work. can't put breakpoint if there no code. (breakpoint point looks white circle not red circle). guess compiler optimizer omit these static variables code in cpp because these variables references nowhere. but, it's constructor don't understand why compiler remove or doesn't make code these static variables.

how prevent these situation? there options that? or knowhow?

turn 'link library dependencies' , 'use library dependency inputs' yes compiler make codes. works. c++ static variable in .lib not initialize force visual studio link symbols in lib file


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -