msvc12

“Function has no address” despite disabled optimization (/Od)

戏子无情 提交于 2019-12-22 02:32:32
问题 During debug in MSVC 2012, I am attempting to call some functions from the Watch window in order to dump data to files. However, I keep getting this error: Function Matrix::Save has no address, possibly due to compiler optimizations. The class Matrix is located in my own external library. A quick check showed that none of the methods in external libraries have addresses and all attempts to call them from Watch return this error, except for those which are defined in the header files. The

Breakpoint: Break when c++ exception is thrown - why so slow?

感情迁移 提交于 2019-12-19 04:46:22
问题 Using Qt Creator, Qt 5.3, VC12 (VS2013) When I set a "Break when c++ exception is thrown" breakpoint in Qt creator, my application becomes extremely slow. Maybe 5-10 slower than running with other breakpoints such as "File name and line number" Why is debugging with this kind of breakpoint so slow? Just curious .. -- Edit -- As of CR's comment, do I face an abnormality on my system? 回答1: It is a problem with the Microsoft-provided debugger that you have downloaded to use with Qt Creator. The

Breakpoint: Break when c++ exception is thrown - why so slow?

♀尐吖头ヾ 提交于 2019-12-19 04:46:10
问题 Using Qt Creator, Qt 5.3, VC12 (VS2013) When I set a "Break when c++ exception is thrown" breakpoint in Qt creator, my application becomes extremely slow. Maybe 5-10 slower than running with other breakpoints such as "File name and line number" Why is debugging with this kind of breakpoint so slow? Just curious .. -- Edit -- As of CR's comment, do I face an abnormality on my system? 回答1: It is a problem with the Microsoft-provided debugger that you have downloaded to use with Qt Creator. The

Possible compiler bug in MSVC12 (VS2013) with designated initializer

早过忘川 提交于 2019-12-18 05:44:13
问题 Using VS2013 Update 2, I've stumbled on some strange error message : // test.c int main(void) { struct foo { int i; float f; }; struct bar { unsigned u; struct foo foo; double d; }; struct foo some_foo = { .i = 1, .f = 2.0 }; struct bar some_bar = { .u = 3, // error C2440 : 'initializing' : cannot convert from 'foo' to 'int' .foo = some_foo, .d = 4.0 }; // Works fine some_bar.foo = some_foo; return 0; } Both GCC and Clang accept it. Am I missing something or does this piece of code exposes a

Possible compiler bug in MSVC12 (VS2013) with designated initializer

∥☆過路亽.° 提交于 2019-12-18 05:44:11
问题 Using VS2013 Update 2, I've stumbled on some strange error message : // test.c int main(void) { struct foo { int i; float f; }; struct bar { unsigned u; struct foo foo; double d; }; struct foo some_foo = { .i = 1, .f = 2.0 }; struct bar some_bar = { .u = 3, // error C2440 : 'initializing' : cannot convert from 'foo' to 'int' .foo = some_foo, .d = 4.0 }; // Works fine some_bar.foo = some_foo; return 0; } Both GCC and Clang accept it. Am I missing something or does this piece of code exposes a

Why does is_copy_constructible return true for unique_ptr in MSVC12

只谈情不闲聊 提交于 2019-12-14 03:44:52
问题 I would have expected this static assertion to fire: #include <type_traits> #include <memory> int main() { static_assert(std::is_copy_constructible<std::unique_ptr<int>>::value, "UPtr has copy constructor?"); } But it does not. Compiled using MSVC12: Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64 回答1: The static_assert should fire, std::unique_ptr has an implicitly deleted copy constructor, so this is a bug. This looks related to this bug report std::is_copy_constructible

Run an executable as service in C++

时光怂恿深爱的人放手 提交于 2019-12-13 04:47:12
问题 I created a Win32Console application using MSVS2013 and it was compiled successfully. Now I tried creating a service using CreateService and binary path was set to the path of the above produced executable. Though I was able to create the service, I cannot start it using StartService . The error code 1053 is thrown each time. I tried using sc.exe and also tried to start the service manually from Services . The same error is shown. How can I solve it now? 回答1: You must create a ServiceMain.

Can not configure compiler and build kit for Qt 5.5

浪子不回头ぞ 提交于 2019-12-12 11:14:28
问题 I just have installed on a clean windows 10, visual studio 2015 and Qt Creator 5.5...I have some source code that depend on some libraries (lib) files which I believe were compiled using msvc2012. The Qt can not compile my project and always complains that selected compiler can not compile for Qt 5.5...I have spent hours on this but still no success...Would someone kindly tell me what should I do? Here is some photos of my Qt build options: 回答1: Visual C++ doesn't maintain binaries

Vector erase iterator outside range [closed]

三世轮回 提交于 2019-12-11 23:47:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Porting some code from my game engine from Mac to Windows in C++, and I get this runtime error: "Vector erase outside range". It works on Mac! void Entity::runDeferreds() { for (auto it = deferreds.begin(); it != deferreds.end(); /* nothing */ ) { if (it->Condition()) { it->Execution(); it = deferreds.erase(it);

Binding functions with multiple arguments results in C2027

对着背影说爱祢 提交于 2019-12-11 22:43:18
问题 I'm using ChaiScript 5.3.1, and I'm trying to bind functions to my own class, specifically a setPosition function which can take either a Vector3 or 3 floats. The class and it's relevant methods are declared like so: class DLLExport Actor { public: Actor(Level* level, const String& name, Actor* parent); virtual ~Actor(); void setPosition(const Real& x, const Real& y, const Real& z); void setPosition(const Vector3& position); }; and I'm trying to bind them like this: m->add(user_type<Actor>(),