c++

Are there any good 3rd party libraries build on top of openCL yet?

I'm thinking in particular of processing primitives, things like FFT, convolution, correlation, matrix mathematics, any kind of machine vision primitives. I haven't been able to find anything along these lines, does anyone know of any good projects that have sprung up? ...

Is the order of initialization guaranteed by the standard?

In the following code snippet d1's initializer is passed d2 which has not been constructed yet (correct?), so is the d.j in D's copy constructor an uninitialized memory access? struct D { int j; D(const D& d) { j = d.j; } D(int i) { j = i; } }; struct A { D d1, d2; A() : d2(2), d1(d2) {} }; Which section of C++ s...

Taking screenshot of a specific window - C++ / Qt

In Qt, how do I take a screenshot of a specific window (i.e. suppose I had Notepad up and I wanted to take a screenshot of the window titled "Untitled - Notepad")? In their screenshot example code, they show how to take a screenshot of the entire desktop: originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId()); How woul...

Parse information from programs added to taskbar with C++

Basically what I am trying to do is write my own pseudo task bar in C++. The program needs to idle until another program is started up, at which point it needs to visually depict that the other program is running. For each other program that is running, the user should be able to click on the visual representation and have Windows switch...

Emacs customization

I'm new to the whole Emacs thing, and one of the things that gets me is that out-of-the-box Emacs doesn't keep you within blocks when programming. I program in mostly Python and C++ and hitting enter sends the cursor back to column 1 on a new line rather than keeping you in the block you're working in. I managed to find this: (add-hook ...

Where do I learn "what I need to know" about C++ compilers?

I'm just starting to explore C++, so forgive the newbiness of this question. I also beg your indulgence on how open ended this question is. I think it could be broken down, but I think that this information belongs in the same place. (FYI -- I am working predominantly with the QT SDK and mingw32-make right now and I seem to have confi...

FastCGI for C++

I've found only two FastCGI libraries for C++. There's the "official" one, and fastcgi++. How is either one better than the other? Do any others exist? ...

create singleton class that has constructor which accepts arguments that are evaluated runtime

I want to have singleton class that its object is not statically created. having the following code, when I call ChromosomePool::createPool() I get the following error message : --> ChromosomePool.h:50: undefined reference to `myga::ChromosomePool::pool' <-- Can anyone please tell me how can I solve the problem ? class ChromosomePool ...

boost linker errors -regular expressions - c++

hi am trying to compile a simple program in boost library but i keep getting linker errors #include <iostream> #include <string> #include <boost\regex.hpp> // Boost.Regex lib using namespace std; int main( ) { std::string s, sre; boost::regex re; while(true) { cout << "Expression: "; cin >> sre; if (...

C++ instantiate templates in loop

hi I have have a factory class, which needs to instantiate several templates with consecutive template parameters which are simple integers. How can I instantiate such template functions without unrolling the entire loop? The only thing that can think of is using boost pre-processor. Can you recommend something else, which does not d...

How to design a C++ API for binary compatible extensibility

I am designing an API for a C++ library which will be distributed in a dll / shared object. The library contains polymorhic classes with virtual functions. I am concerned that if I expose these virtual functions on the DLL API, I cut myself from the possibility of extending the same classes with more virtual functions without breaking bi...

Can I use a shared library compiled on Ubuntu on a Redhat Linux machine ?

I have compiled a shared library on my Ubuntu 9.10 desktop. I want to send the shared lib to a co-developer who has a Red Hat Enterprise 5 box. Can he use my shared lib on his machine? ...

SIGINT handling and getline

I wrote this simple program: void sig_ha(int signum) { cout<<"received SIGINT\n"; } int main() { string name; struct sigaction newact, old; newact.sa_handler = sig_ha; sigemptyset(&newact.sa_mask); newact.sa_flags = 0; sigaction(SIGINT,&newact,&old); for (int i=0;i<5;i++) { cout<<"Enter text: "; getline(cin,name)...

Visual C++ Express, the debugger, sorted associative containers and memory deallocation

So you have this simple program that creates a set from a file : #include <fstream> #include <string> #include <set> int main() { std::set<std::string> Sdictionnary; std::set<std::string>::const_iterator it = Sdictionnary.begin(); std::ifstream file("french.txt"); // A file containing 200 000 lines std::string line; while(getline...

C++ program problem

I am new to C++ programming. So I was trying my luck executing some small programs. I am working on HP-UX which has a compiler whose executable is named aCC. I am trying to execute a small program #include <iostream.h> using namespace std; class myclass { public: int i, j, k; }; int main() { myclass a, b; a.i = 100; ...

Basic question in C++

I am new to C++ and I have some confusion regarding this program. I am running this in Visual Studio 2008 as win32 console application. #include <iomanip> #include <cmath> #include <string> using namespace std; #define PI 3.14 int l=1; int x; void main() { do { cout << "cho...

How can i open C++ or Java project S60 5th Edition SDK 1.0 with Netbeans

i installed S60 5th Edition SDK 1.0 but i cant open project on netbeans? what can i do? maybe install some netbeans plugin. ...

Strange class behaviour when used inside a Qt app

I've a simple class with these, also simple, constructors: audio::audio() { channels = NULL; nChannels = 0; } audio::audio(const char* filename) { audio(); getFromFile(filename); } (Before it was audio():channels(NULL), nChannles(0), loaded(false){..., I'll say later why this changed...). The function getFromFile sta...

Out of memory on _beginthreadex

I currently debug a multi threaded application, which runs without errors until some functions where called about 2000 times. After that the application stops responding, which I could track down to _beginthreadex failing with an out of memory error. When examining the Application in ProcessExplorer I can see a growing number of thre...

C++ new standard, technologies and more

I'm developing in C++ mainly. i used to develop using VS 2005 with libraries like MFC , sometimes using COM. only on WIN platform. as i took a break from programming for a year, I want to be able now to get acquainted with all the new features and technologies being used today with C++. Is MFC still worth something today ? Are there a...