c++

How to complete a git clone for a big project on an unstable connection?

I am trying to git clone the LibreOffice codebase, but at the moment I have an internet connection by mobile phone and it's just anything but stable. I can get the connection back any moment, but then the git clone process already stopped working, and no way to get it running again. Is there some way to have a more failure-resistant git ...

OpenGL: Sending RGBA color struct into glColor*() as one parameter?

Is there some way to send a struct like: struct COLOR { float r, g, b, a; }; directly into glColor*() function as one parameter? Would make the code nicer. I could make own function and send separetely each R,G,B,A values onto glColor4f() but that wouldnt be that nice. So im looking a way to send it the most optimal way as possib...

WM_PAINT not being called after window is created.

I've been playing around with the Windows api for uni, but I cant get the window messages to call WM_PAINT after the inital creation. It calls it when the window is created but not after. All Other messages get called! Just cant get the WM_PAINT to be called. This is part of a game lib we have to make using the Windows api, (the goal i...

fstream absolute path doesn't work

This is really strange. Absolute path doesn't work for both ifstream and ostream. It works when I use a relative path like so: ofstream out; out.open("file2.txt"); string river = "i love cheese"; if(!out){ cout << "error"; // have breakpoint set here } else { out << river; // have breakpoint set here (stops here when debugging)...

getch Alternative

As most know getch waits until the user hits a key and then returns the value. Is there a way in order to just check if the user is currently hitting a key? Here is what I'm trying to do: while(1){ char x = getch(); if (x){ //blah } else if(y == true){ //blah } } Any suggestions? ...

Ensuring a reference that will not become invalid is given

I'm making a TextField class, which at the moment stores a reference to a variable, and whenever the programmer wants, they can call TextField.show() and the referenced variable will be read and displayed on-screen. This however can result in problems if the reference becomes invalid. For example, if the variable referenced goes out of ...

msvc + GNU make

I understand that the fastest and the most lightweight binary at windows generate only msvc compiler Express edition of msvc is free http://www.microsoft.com/express/windows/ but how to use cl.exe instead of g++.exe? is it possible in common by using GNU make variables produce makefiles which will works with cl.exe and g++? for examp...

ISO C++ and the infamous underscore

Possible Duplicate: Why is getcwd() not ISO C++ compliant? After searching for availability of execvp on Windows, particularly with VisualStudio, I've ended up with http://msdn.microsoft.com/en-us/library/ms235414.aspx ... However, it says I should use _execvp instead of execvp. GCC also seems to support _execvp. But what's t...

unexpected change of wchar variable

Okey this is driving me crazy now... I'm working on a directX game in c++ and I got a global wchar variable called FpsString witch i declared like this: WCHAR * FpsString; And in my initialization code i initialized it like this: WCHAR a[100]; FpsString = a; Okay, here is the prob... FpsString suddenly changes to some Japanes...

Building and Using a DYLIB in Xcode

I'm trying to build a .dylib in Xcode. Currently the .dylib builds, but when I drag the .dylib into another project and try to #import one of the headers (Seeker.h) in the .dylib, I get this error: *: No such file or directory Seeker.h: No such file or directory The project is available as an Xcode project here. I can confirm...

Saving H.264 RTP stream without re-encoding ?

My C++ application receives a H.264 RTP video stream. Right now it decodes the stream, saves it into a YUV file and later I use ffmpeg to re-ecode the file into something suitable to watch on a Windows PC (eg. Mpeg4 AVI). Shouldn't it be possible to save the H.264 stream into a AVI (or similar) container without having to decode and re...

Trouble creating a map with vector as key and custom class as value.

Hey everybody, I have created the abstract class below to evaluate a board position of simple games. The abstract class is overridden by each derived class so that only the evaluate function is defined in game.h I am trying to make my program more efficient by using memoization, but I can't get my map to work correctly. The compiler th...

Need a way in C++ to set the DNS servers on all interfaces

I'm writing a small tray app in C++ for Win XP/7, with the objective that as long as the app is running, http://*.dev will point to http://localhost. This is part of a mod for XAMPP/WAMP to permit directory-named virtual domains on localhost (so, for example, http://test.dev/index.php will map to G:\xampp\virtual\test\index.php) Part o...

C++ Win32 API offline documentation?

I'm learning win32 apps with C++. I've got a pretty good API reference, but it's from 1997. Is there a more modern version available for download? My connection is horrendous so I'd like it to be fully accessible offline. Something akin to a chm or hlp file...searchable and up to date-ish. ...

directx 9 stop/play animated mesh c++

ok im not expecting to get answer fast. does directx 9 have function that will stop or pause animated mesh. i need an example how the function works or it is useless. thanks in advancee ...

how to list class methods in gdb?

I've been googling for this and checking through the gdb manual but can't seem to find an answer to what I'm trying to do. Is there a way to get gdb to print out a listing of all the methods for a given class type? The print command only seems to show the data members and fields, none of the methods are displayed for it. Additionally, ...

LNK2019: Error. unresolved external symbol in C++ program using InternetOpen InternetReadFIle

I have tried writing a simple program to get information from a website. I can't compile as I get the LNK2019 error for InternetReadFile, InternetOpenUrl, etc. and e.g. 1>GetInternetInfo.obj : error LNK2019: unresolved external symbol _imp_InternetReadFile@16 referenced in function _main I assume that means I did not define these fun...

Debug a module built with Boost.Python in QtCreator

I have a module built with Boost.Python and I want to debug it in QtCreator (or perhaps gdb). I prefer a visual environment if possible. ...

Changing Warning Level for 3rd Party Libs

I generally like to compile against warning level 4 in Visual Studio and treat all warnings as errors. The problem is, Ogre3D is not compiled with warning level 3 (neither is FBX SDK or OIS, which I am also using), and that poses a problem because now I have a ton of warnings from Ogre3D libraries that are now treated as errors. So far I...

C++ on Linux not recognizing commands like exit() and printf()

I get these errors after issuing a g++ command on a .cpp file: error: ‘exit’ was not declared in this scope error: ‘printf’ was not declared in this scope The problem is that when I compiled this program on another linux machine, everything went fine. I tried searching around, but all I found was that I need to include files like 'stdli...