cpp forever

Members
  • Content count

    109
  • Joined

  • Last visited

Community Reputation

150 Neutral

About cpp forever

  • Rank
    Member
  1. Hello. I want to create a GNU makefile target smth like this: test: -printf "printf ok" echo "printf fails, echo ok" But I want to execute echo "printf fails, echo ok" only when previous command (-printf "printf ok") returns non-zero. How to do that IF checking? Does GNU makefile provides smth like this? ------ Under linux, bash.
  2. [GNU make] makefile includes

    Yes, it does work. Thanks. Sepcifying MAKEFILES variable is great idea.
  3. How can I include found files in makefile? Currently I'm having in my makefile: include "makefile1.mk" include "makefile2.mk" include "makefile3.mk" But I want to rewrite this in the following way: include `find *.mk` But it doesn't work. Is it possible, anybody knows how?
  4. Found one possible solution: kilall smth > /dev/null > 2&>1
  5. Hello. I'm having problem with C & ncruses (under Linux). Whenever I try to call e.g. system("killall smth"); it just prints its output under my ncurses application output and breaks everything. How can I force to print it to somewhere, e.g. syslog? Any help?
  6. Hello, I'm using Microsoft Visual C++ 2005 Express Edition. I have created a makefile project that executes curl as build command. It provides an output in one line. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 1 1380k 0 0 1 16384 0 271k 0:00:05 --:--:-- 0:00:05 271k 35 1380k 0 0 35 496k 0 339k 0:00:04 0:00:01 0:00:03 342k 35 1380k 0 0 35 496k 0 201k 0:00:06 0:00:02 0:00:04 199k 35 1380k 0 0 35 496k 0 143k 0:00:09 0:00:03 0:00:06 141k 35 1380k 0 0 35 496k 0 111k 0:00:12 0:00:04 0:00:08 109k 35 1380k 0 0 35 496k 0 93005 0:00:15 0:00:05 0:00:10 90988 35 1380k 0 0 35 496k 0 78610 0:00:17 0:00:06 0:00:11 0 35 1380k 0 0 35 496k 0 68065 0:00:20 0:00:07 0:00:13 0 35 1380k 0 0 35 496k 0 60021 0:00:23 0:00:08 0:00:15 0 35 1380k 0 0 35 496k 0 53678 0:00:26 0:00:09 0:00:17 0 35 1380k 0 0 35 496k 0 48547 0:00:29 0:00:10 0:00:19 0 35 1380k 0 0 35 496k 0 44311 0:00:31 0:00:11 0:00:20 0 35 1380k 0 0 35 496k 0 40752 0:00:34 0:00:12 0:00:22 0 37 1380k 0 0 37 512k 0 39924 0:00:35 0:00:13 0:00:22 3508 66 1380k 0 0 66 912k 0 64410 0:00:21 0:00:14 0:00:07 84570 66 1380k 0 0 66 912k 0 60254 0:00:23 0:00:15 0:00:08 84570 66 1380k 0 0 66 912k 0 56602 0:00:24 0:00:16 0:00:08 84570 66 1380k 0 0 66 912k 0 53368 0:00:26 0:00:17 0:00:09 84587 66 1380k 0 0 66 912k 0 50483 0:00:28 0:00:18 0:00:10 76318 67 1380k 0 0 67 928k 0 48565 0:00:29 0:00:19 0:00:10 3232 67 1380k 0 0 67 928k 0 46203 0:00:30 0:00:20 0:00:10 3232 67 1380k 0 0 67 928k 0 44061 0:00:32 0:00:21 0:00:11 3232 68 1380k 0 0 68 944k 0 43332 0:00:32 0:00:22 0:00:10 6813 97 1380k 0 0 97 1344k 0 58133 0:00:24 0:00:23 0:00:01 85481 97 1380k 0 0 97 1344k 0 55777 0:00:25 0:00:24 0:00:01 83411 97 1380k 0 0 97 1344k 0 53605 0:00:26 0:00:25 0:00:01 83411 97 1380k 0 0 97 1344k 0 51595 0:00:27 0:00:26 0:00:01 83411 97 1380k 0 0 97 1344k 0 49731 0:00:28 0:00:27 0:00:01 76332 97 1380k 0 0 97 1344k 0 47996 0:00:29 0:00:28 0:00:01 0 97 1380k 0 0 97 1344k 0 46379 0:00:30 0:00:29 0:00:01 0 97 1380k 0 0 97 1344k 0 44867 0:00:31 0:00:30 0:00:01 0 97 1380k 0 0 97 1344k 0 43450 0:00:32 0:00:31 0:00:01 0 97 1380k 0 0 97 1344k 0 42120 0:00:33 0:00:32 0:00:01 0 97 1380k 0 0 97 1344k 0 40869 0:00:34 0:00:33 0:00:01 0100 1380k 0 0 100 1380k 0 40664 0:00:34 0:00:34 --:--:-- 7331100 1380k 0 0 100 1380k 0 39527 0:00:35 0:00:35 --:--:-- 7331100 1380k 0 0 100 1380k 0 38452 0:00:36 0:00:36 --:--:-- 7331100 1380k 0 0 100 1380k 0 38288 0:00:36 0:00:36 --:--:-- 8787 But it must change first line with the next one with some time interval. How do I achieve this? Or, at least, how do I show this output in separate lines.
  7. How to stretch surfaces?

    Quote:Original post by Evil Steve IDirect3DDevice9::StretchRect()? If you're using D3D, it's usually a bad idea to read or write directly to the backbuffer. You'd probably be better off creating a texture with one mip level, and then drawing a single screen sized textured quad. You could also make use of alpha blending and render to texture to do layers and transparancy and other cool stuff if you want to combine images onto one another, or make your app into an image editor. What language / compiler / DirectX version are you using? Thanks, Steve. I'm using MSVC 2005, DirectX 9. I'm now trying to use textures with one mip map level and it works great. One more question about textures. I use D3DXCreateTextureFromFileEx() function to create textures. I have noticed that this might be performance effective to create textures whenever I want to open a new image: e.g. image 1280x960 image will be placed into 2048x1024 texture. So 2048x1024 texture is created every time. Why there are no D3DXLoadTextureFromFileEx function available or else?:( Or maybe iimage can be loaded into texture in some other way? How do you think? Thanks.
  8. 2 linkofazeroth: Yes, right. Thanks. Now I understand how this could be solved. I have tried to remove 'Always on Top' tick from Winamp and now it works with Alt-Tab queue as expected. Maybe we somehow need to remove "Always on Top" flag from the Direct3D application (at least for the time when we press Alt-Tab)?
  9. Quote:Original post by S1CA It sounds like you aren't handling lost devices properly. Take a read of: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/Lost_Devices.asp?frame=true Have read this and implemented everything like said there. Also I have noticed such a bug in several DirectX games I have tried.
  10. Hello. I'm writing the image viewing application. I was about to implement some image zoom in/out. What I want to do on zoom-in is to have to copy part of the image that is currently on the screen to back buffer. Then run Direc3D device Present(). Image copying also requires that part of image to get stretched to fit the screen. How do I implement image copying with stretching in best way?
  11. I'm writing a full-screen Direct3D application. But the problem is when I press ALT-TAB and then press ALT-TAB again - it doesn't return to my Direct3D app. Simply to some other window (looks like non-standart windows behaviour, I think). What do you think? Thanks. P.S. I have also noticed that the same thing happens with Winamp. It must use some Direct3D features also, I think.
  12. solved this issue putting includes into 'extern "C"'.
  13. I have said that I have add it. [pre] -lethereal [/pre] When not adding library and using 'extern "C" __declspec(import)' instead of 'extern' I get [Linker error] undefined reference to `_imp__proto_register_protocol' .
  14. I'm building a program, which uses some import library. I have successfully created .a import library (Dev-C++, GCC, Win32) using dlltool, but can't link correctly with my program. I have found that include files (can't change them) for that library has functions in style of: extern int proto_register_protocol(const char *name, const char *short_name, const char *filter_name); So there is no __declspec(import) (or else) declared. When I change 'extern' to 'extern "C" __declspec(import)' my program links ok. But I don't want to change headers. How can I force linker to find 'proto_register_protocol' in import libraries and not showing me 'undefined reference to'?
  15. Doesn't GCC support wstringstream: Writing #include <sstream> #ifdef _UNICODE typedef std::wstringstream stringstream; #else typedef std::stringstream stringstream; #endif // _UNICODE stringstream ss; causes errors for me like this: syntax error before `;' token Everything is Ok w/ non Unicode version.