Hi, I'm writing some code where I defined the following base class.
class Chorus{
public:
//Destructor
virtual ~Chorus();
//callback function
virtual int callback( void *outputBuffer, void *notUsed, unsigned int
nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData );
virtual void ...
Hi, I'm getting the LNK2005: already defined in (...) error when building my project in Visual Studio 2008. I've referenced other related questions, but mine seems to be a bit more complicated due if nothing else to the number of files I'm working with.
First, I think it will be helpful for me to map out the #include statements I have i...
#include <iostream>
using namespace std;
class Foo
{
public:
Foo(): initialised(0)
{
cout << "Foo() gets called AFTER test() ?!" << endl;
};
Foo test()
{
cout << "initialised= " << initialised << " ?! - ";
cout << "but I expect it to be 0 from the 'initialised(0)' initialiser on Foo()" << endl;
cout << "this method test(...
Refactored from bug_report_view.cc and bug_report_view.h, I extracted send_report(), report_phishing(), a few other smaller functions and BugReport::Cleanup into bug_report.cc and bug_report.h (my versions). Compiling now, I get:
[...]bug_report.cc:196: error: no matching function for call to ‘URLFetcher::URLFetcher(std::wstring&, UR...
Considering the following two usage scenarios (exactly as you see them, that is, the end-user will only be interested in using Vector2_t and Vector3_t):
[1]Inheritance:
template<typename T, size_t N> struct VectorBase
{
};
template<typename T> struct Vector2 : VectorBase<T, 2>
{
};
template<typename T> struct Vector3 : VectorBase<T, ...
Does anyone know a reason why my programs could be causing my speakers to output some soft static? The programs themselves don't have a single element that outputs sound to anything, yet when I run a few of my programs I can hear a static coming from my speakers. It even gets louder when I run certain programs. Moving the speakers around...
Linking...
Directory.obj : error LNK2019: unresolved external symbol "public: void __thiscall indexList<class entry,100>::read(class std::basic_istream<char,struct std::char_traits<char> > &)" (?read@?$indexList@Ventry@@$0GE@@@QAEXAAV?$basic_istream@DU?$char_traits@D@std@@@std@@@Z) referenced in function _main
Getting this error and o...
i have a problem with my program. It should be program that recognize palindome through the stack. Everything works great, only thing that don't work is printing stacks(original and reversed) after the funcion is done.
Here is my entire code, and the problem is at case d and e:
#include <iostream>
using namespace std;
const int MAXST...
Will the initialization list always be processed before the constructor code?
In other words, will the following code always print <unknown>, and the constructed class will have "known" as value for source_ (if the global variable something is true)?
class Foo {
std::string source_;
public:
Foo() : source_("<unknown>") {
std::c...
If a HANDLE is an output parameter, is it necessary to use a reference to the HANDLE or
use HANDLE directly?
bool fn(HANDLE h_result);
or
bool fn(HANDLE& h_result);
...
I'm using Linux and GLUT. I have a square as follows:
glVertex3f(-1.0, +1.0, 0.0); // top left
glVertex3f(-1.0, -1.0, 0.0); // bottom left
glVertex3f(+1.0, -1.0, 0.0); // bottom right
glVertex3f(+1.0, +1.0, 0.0); // top right
I guess I can't use glutBitmapCharacter, since this is only ideal for 2D ortho.
Simple enough, I'd like to re...
Dear all,
I have no problem compiling specific code the following way:
g++ -I /opt/local/include Code1.cc -o Code1
However when I tried to do that in the makefile:
CXX = g++ -Wall -Werror -gstabs -pedantic -O2 -g
all: Code3 Code2 Code1
Code3: Code3.cc Tools.cc
$(CXX) $^ -o $@
Code2: Code2.cc Tools.cc
$(CXX) $^ -o $@
...
I have a program in which I want to be able to store certain data (dynamically allocated blocks), on disk for reduced memory usage and persistence.
My first thought was to write my own custom allocator which managed the content of files on the disk, but I want to see what alternatives there are too.
I've looked into custom memory alloc...
Does anyone know why there is some hesitation when you hold down a keyboard key and try to process it? I'm calling a function right in my WinProc(...) that will move an image on the screen (OpenGL) when a key is held down. I press it and get a single response, then there is about .5 seconds of nothing, then it behaves as normal (moves 1 ...
I downloaded zthreads (found here: http://zthread.sourceforge.net/) and tried to compile but I get this error from make:
MutexImpl.h:156: error: there are no arguments to 'ownerAcquired' that depend on a template parameter, so a declaration of 'ownerAcquired' must be available
MutexImpl.h:156: error: (if you use '-fpermissive', G...
Dear all:
We are programming a logging library that keeps itself in a .hpp file. We would like to include <tr1/unordered_map> (if the compiler supports TR1,) or the standard <map> otherwise. Is there a standard way of checking at compile time if tr1 is available or not?
I was thinking that the same way that the "__cplusplus" define sym...
I'm using the pthread library on Linux.
I'm assigning a string in thread A, and then trying to print the string in thread B. However, the string just prints out empty (I have verified that it works in thread A).
Note: The string resides inside an object, which I suspect may be getting cleaned up or re-instantiated empty... The containe...
I just realized after years of writing C++, that I can safely delete a NULL pointer. So I figure, I'm not the only one that wasn't aware of this. Now I feel silly for all my
if(p) delete p;
code laying around.
Am I the only one that hadn't realized this? Or is it a less known feature of C++?
...
I am trying to create an mshtml document object from an html buffer. But when the following code is executed it is invoking internet explorer window. How do I prevent it invoking IE.
#include <atlbase.h>
#include <mshtml.h>
CoInitialize(NULL);
CString strHTMLCode = _T("<html><head><script language=\"JavaScript\">{top.location.href=\"...
I'm doing a simple ray tracer in C++ using SDL for graphics and pthread for threading. And I have a problem making my program utilizing two cores, the threads work, they just don't drive both cores to 100%. To interface SDL I write directly to it's memory, SDL_Surface.pixels, so I assume that it can't be SDL locking me.
My thread functi...