Global variables and scope - C++

前端 未结 4 541
北荒
北荒 2021-01-01 02:57

I am having small problem in making a global variable works. I am using Visual Studio 2008 and standard C++.

I have two projects, one is a static library and second

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 03:34

    The kind of behavior you describe seems more like a problem when you have a DLL, but you are saying that your library is static, which looks weird.

    Anyway, take care with global variables in multiple libraries, if you have a shared code library (DLL) you'll get a value for each part. Check out this question, can be useful.

提交回复
热议问题