visual-c++

OpenGL window isn't opening

為{幸葍}努か 提交于 2020-01-11 12:09:11
问题 I have code from the OpenGLBook (openglbook.com) which compiles, but does not load. I have absolutely no idea why it's not loading. The code is as follows: main.cpp #include "main.h" /// Methods /// ----------------------------- int main(int argc, char* argv[]) { Initialize(argc, argv); glutMainLoop(); exit(EXIT_SUCCESS); } main.h #ifndef main_h #define main_h #include <cstdlib> #include <cstdio> #include <cstring> #include <GL/glew.h> #include <GL/freeglut.h> #define WINDOW_TITLE_PREFIX

How to split the strings in vc++?

谁都会走 提交于 2020-01-11 11:51:25
问题 I have a string "stack+ovrflow*newyork;" i have to split this stack,overflow,newyork any idea?? 回答1: First and foremost if available, I would always use boost::tokenizer for this kind of task (see and upvote the great answers below) Without access to boost, you have a couple of options: You can use C++ std::strings and parse them using a stringstream and getline (safest way) std::string str = "stack+overflow*newyork;"; std::istringstream stream(str); std::string tok1; std::string tok2; std:

bison.exe cannot find file m4sugar.m4 which is required by an MSBuild in VS2010

左心房为你撑大大i 提交于 2020-01-11 10:40:08
问题 I am trying to compile QGIS in Visual Studio. I used OSGeo4W to download the packages, added Flex.exe and Bison.exe to my environment path. Downloaded QGIS Release 2.0, and launched a CMake-GUI with the option "Visual Studio 10". Then I configured my paths using the GUI tool. Then I hit configure and generate, and it worked. I looked in my directory and there were Visual Studio Solution files available for me. Then I hit "Build All" and I got the following output in the "Output Window"

Finding the center of a contour using opencv and visual c++

家住魔仙堡 提交于 2020-01-11 10:32:12
问题 I want to find the center of a contour without doing so much calculations. Is there a built in function for that in opencv? 回答1: for the 'geometric center', get the boundingRect() of the contour, then: cx = br.x+br.width/2; cy = br.y+br.height/2; for the 'center of mass' get the moments() of the contour, then: cx = m.m10 / m.m00; cy = m.m01 / m.m00; 回答2: Either you haven't done any research, or these questions already asked and answered here are not what you are asking: centroid of contour

How do you convert a 'System::String ^' to 'TCHAR'?

岁酱吖の 提交于 2020-01-11 10:25:32
问题 i asked a question here involving C++ and C# communicating. The problem got solved but led to a new problem. this returns a String (C#) return Marshal.PtrToStringAnsi(decryptsn(InpData)); this expects a TCHAR* (C++) lpAlpha2[0] = Company::Pins::Bank::Decryption::Decrypt::Decryption("123456"); i've googled how to solve this problem, but i am not sure why the String has a carrot(^) on it. Would it be best to change the return from String to something else that C++ would accept? or would i need

Reading VC++ CArchive Binary Format (or Java reading (CObArray))

核能气质少年 提交于 2020-01-11 10:09:12
问题 Is there any clear documentation on the binary formats used to serialize the various MFC data structures? I've been able to view some of my own classes in a hex editor and use Java's ByteBuffer class to read them in (with automatic endianness conversions, etc). However, I am currently running into issues while trying to bring over the CObArray data, as there seems to be a rather large header that is opaque to me, and it is unclear how it is persisting object type information. Is there a set

MS VC linker (link.exe): Why no warning for 32/64 bit CPU architecture mismatch?

二次信任 提交于 2020-01-11 09:52:12
问题 (Update: As per Hans' suggestion, here's a suggestion to improve link.exe's behaviour, and you can vote for it if you have an account over there.) Okay, I'm a fool. In January I installed Oracle on my computer, Win7 Pro 64 Bit. I installed the 64 Bit version. Yesterday, using MSVC Express, I tried to compile and link a small test programm oci1.c against oci.h and oci.lib . cl /nologo /c /I%ORACLE_HOME%\oci\include oci1.c link /nologo oci1.obj /LIBPATH:%ORACLE_HOME%\oci\lib\msvc oci.lib My

How to detect if the Windows DWORD_PTR type is supported, using an ifdef?

可紊 提交于 2020-01-11 09:52:08
问题 There are some new integer types in the Windows API to support Win64. They haven't always been supported; e.g. they aren't present in MSVC6. How can I write an #if condition to detect if these types are supported by <windows.h> ? (My code needs to compile under many different versions of Microsoft Visual C++, including MSVC6. So I need to provide my own definitions of these types, with an #if to disable them in newer compilers). (For searchers, the full list of types is: DWORD_PTR, INT_PTR,

Inquiry: Integrating libsndfile with Visual Studio 2010 C++. Error: libsndfile.dll not found

99封情书 提交于 2020-01-11 09:32:13
问题 I am teaching myself how to read in wav files into C++ as a part of me learning C++. I have found many resources online that recommended the following library: libsnfile library So I followed some tutorials below in testing the basic functionality of the library, but I can't get the library to compile with Visual Studio 2010. I have searched online for the following error, but did not find anything useful for my particular error. I downloaded the libsndfile C++ windows installer found here. I

VS2013 “v120_xp” as platform toolset by default

自闭症网瘾萝莉.ら 提交于 2020-01-11 09:27:07
问题 In order to deploy C++ application built with VS2013 compiler under Windows XP, the "v120_xp" platform toolset has to be set: this make it possible the deployment from XP to 8.1. So next come the question: why this platform toolset is not the only one and the default? The "v120" platform toolset is suitable starting from Windows Vista. Is there any performance drawback? I've tested an application built towards both the platform toolsets under Windows 8 but I've seen no difference in