c++

What is g++-3 / gcc-3?

Trying to use make from cygwin using g++ I was getting Access Denied error messages. Googling the error message I found a positing referring to g++-3 and gcc-3 http://www.linuxquestions.org/questions/linux-software-2/cygwin-g-3-exe-gcc-3-exe-corrupted-to-g-3-exe-dam-and-gcc-3-exe-dam-769722/)... Changing the compiler to g++-3 seems ...

Can I use Qt without qmake or Qt Creator?

Hello, I want to program using Qt, but I don't want to use special compilers or IDE such as Qt Creator and qmake. I want to write with Kate and compile with g++. Can I compile a program that uses Qt with g++? How do I compile it with g++? Thanks. ...

C++ IWebBrowser2 - IE - Access Image Cache

Hello, I am currently automating some requests with the IWebBrowserApp Object. Now I want to save an image, that is NOT saved in Cache (due to http headers). Also I can not just download it from the image url, not even when using a second IWebBrowserApp Object and getting the response as stream (html code, or server errors to prevent dow...

How to make a PHP extension

I know you can technically make PHP extension just by making a PHP file and using require_once. But would it optimize the performance if you wrote an extension in C or C++. If so, how would you make a "hello-world" for that? ...

g++, doubles, optimization and a big WTF

bug in my gcc? bug in my code? both? http://files.minthos.com/code/speedtest_doubles_wtf.cpp Somehow, it manages to "optimize" a function that results in the array of doubles being zeroed out into taking 2.6 seconds on my q6600, instead of the 33 ms the more complex function takes to fill the array with something somewhat meaningful. ...

Proper way to pan and move camera in OpenGL?

Right now I'm panning by glRotating before rendering everything, and i'm moving the camera by gltranslating. I feel as if this is wrong since im essentially moving the scene, not the camera. What is the proper way to move the camera? Thanks ...

Why would a friend function be defined as part of a struct - boost thread_data?

I'm trying to understand some boost code which is causing PC-Lint grief and uses the friend keyword in a way which I didn't think was legal C++ but compiles OK in VS2008. I thought I understood friend as a way to declare classes and functions. I didn't think it was legal to use on a function definition like this. However, the MSDN page ...

Projecting a texture in OpenGL

FIXED by setting near clipping plane to 1, rather than 0 (not sure why it was like that to start with). See the question for skeleton code, and Adrian's answer for how and why this works. I have a few different camera positions, and my scene consists of a single quad. The quad is such that it projects exactly onto the viewport/window i...

set/get methods in C++

Java programmers and API seems to favor explicit set/get methods. however I got the impression C++ community frowns upon such practice. If it is so,is there a particular reason (besides more lines of code) why this is so? on the other hand, why does Java community choose to use methods rather than direct access? Thank you ...

C++ tag --- Benefit of solution in VC++2008

I made a simple CAD (MFC) using VC++6.0. I want to move to VC++2008. Should I make one Solution and make all my exe and DLLs to many projects? I opened an old module and it was automatically converted to xxx.vcproj (project) in VC++2008. - How do I create an empty project and how do I add existing projects to it? As a Solution structu...

What does this C++ syntax mean and why does it work?

I was looking through the source of OpenDE and I came across some wierd syntax usage of the operator[] on a class. Here's a simplified example to show the syntax: #include <iostream> class Point { public: Point() : x(2.8), y(4.2), z(9.5) {} operator const float *() const { return &x; } private: float x, y,...

Friends confusion

$11.4/5 - "[...]A friend function defined in a class is in the (lexical) scope of the class in which it is defined[...]" What does this statement mean? struct A{ typedef int MYINT; void f2(){f();} // Error, 'f' is undefined friend void f(){MYINT mi = 0;} // Why does this work, shouldn' it be A::MYINT? ...

C++ XLST tranform not working using MSXML 3.0

Hi guys, I'm new to C++ and inherited the following code that is supposed to transform the given XML using the XSLT file to just spit out the text values. It loads both the XML and XSLT fine and the transformnode() call returns success but no transformation has been applied. The original output at the bottom contains the original XML i...

Forward Declaration vs Include

Consider the following two scenarios (Edited just to complete the whole question and make it clearer) Case 1: (doesnt compile as rightly mentioned below) //B.h #ifndef B_H #define B_H #include "B.h" class A; class B { A obj; public: void printA_thruB(); }; #endif //B.cpp #include "B.h" #include <...

Looking for a C++ GUI library in which you can design fancy GUIs (like for games),

Looking for a C++ GUI library in which you can design fancy GUIs (like for games), something in which you can make something beautiful (rounded buttons with rollover effects, embed beautiful background graphics, cool and colorful scrollbars and progress bars, etc.) It needs to be open source & allowed to be used in proprietary software...

loading binary data for an encryption program

how do i load a file into my program so it's just binary. i want to read the binary from a file then save it to another one so the file will be a clone of the first file (if it's a exe it will run, etc). i would like to store the data in a array or string so i can edit it before i save it. im using windows 7 , microsoft c++ 2008. ...

pthread sleep linux

I am creating multiple threads programme using pthread. Is sleep() cause the process ( all the threads) to stop executing or just the thread where I am calling sleep? Thanks ...

c+ stl sorted vector inplace union

I'd like an efficient method for doing the inplace union of a sorted vector with another sorted vector. By inplace, I mean that the algorithm shouldn't create a whole new vector or other storage to store the union, even temporarily. Instead, the first vector should simple grow by exactly the number of new elements. Something like: vo...

getting started with http tunneling

I will soon start work on software which runs on different machines and communicates over the network. I'd like the communication to happen using HTTP tunneling, so no firewall ports need to be opened by the user. This software will be written in C++. My problem is I don't really know where to start looking for resources regarding imp...

Largest representable negative floating-point number

What is a platform-independent way of specifying the largest representable negative floating-point number? We found an algorithm that broke when run on a PS3's SPU, but worked fine when compiled for the PPU: float x = -FLT_MAX; /* stuff */ if (x > 0.0f) { // If x is unchanged, code is executed on SPU } Essentially, is there a wel...