• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

282 Neutral

About random_thinker

  • Rank
  1. Using Fedora 12 GCC 4.4.4 Code::Blocks 10.05. Decided to try to cross-compile applications for Linux and MS Vista within the Fedora environment using MinGW. After rebuilding the boost 1.44 libraries with bjam everything has worked well. I've been testing the results on a separate Vista system this afternoon. I'm shocked at just how slow execution is on the Vista machine, however. By a factor of at least 5 (yes five!) slower than the Fedora machine. Cannot understand why this should be. The tests involve intensive random number generation, streaming and other computations. I've tried to find out why this is happening, been looking on the internet for solutions (if any) but nothing so far. Thought I would throw this out to the pros and see if there are any improvements to be had...
  2. Boost's undefined references

    Fixed by discarding the Fedora precompiled mingw_win32 binaries and instead downloading latest boost source (boost 1.44) and rebuilding everything under bjam.
  3. Boost's undefined references

    Good news. Funny I'm trying to set up the cross compile system in Fedora 12 x64 using wine, mingw32 + code::blocks. Everything seems to work out of the box except boost::threads. Getting the error: undefined reference to `boost::this_thread::interruptible_wait(void*,boost::detail::timeout)'
  4. Boost's undefined references

    I've been doing some testing of the mingw32 system under Fedora. This allows Windows apps to be compiled under Linux. There is a mingw pthreads-w32 library, and this requires the linker switch -lpthread. I believe that the boost threads library requires this. If you haven't had any joy yet you may want to install this library and use the linker switch. The library can be found at: http://sourceforge.net/projects/mingw/files_beta/MinGW/pthreads-w32/
  5. C++0x Opinions: ready to be used in projects?

    Thanks for the link to MSVC 10. Looks like the way to go in Windows. Just discovered that GCC 4.4 does not support lambda. [sad] Have to upgrade to 4.5 for that, it seems. Also investigating Windows cross-compile environment within Fedora.
  6. C++0x Opinions: ready to be used in projects?

    Quote:Original post by Shinkage Quote:Original post by random_thinker There are a few other things that I would like to use but I can't find anything about compiler support. These are: range for statement initializer lists GCC Support So GCC supports both of these, but the version you're using only the second of them. If you're using GCC, I can't think of any reason NOT to go ahead and start bringing C++0x into your project, unless there are others working on it who might object. Actually, I think the latest MSVC supports a very nicely chosen subset of features to start using immediately. This particular subset is unlikely to undergo changes before finalization. Thank you for your help and the link. GCC 4.5 seems to be a really major upgrade with the inclusion of the MPC library and profiling. Looking forward to that. We use GCC exclusively except at times under Windows where MSVC has some advantages.
  7. C++0x Opinions: ready to be used in projects?

    The compiler support is greatly varied, but it seems that GCC, MSVC, Intel and a few others from time to time, support the following: auto decltype lambda long long right angle brackets rvalue references built-in type traits There are a few other things that I would like to use but I can't find anything about compiler support. These are: range for statement initializer lists and STL improvements: thread new pointers new containers time utilities TBH, I'm using boost to do the things that are new in the STL. So that's not so critical. But the other stuff looks very beneficial. Since I'm using GCC 4.4 under Fedora (GCC seems to be the early adopter of C++0X), then I don't expect that I'll have trouble using any of these. I would expect that the Apple OS would also be easily ported, and that MS Windows Vista or 7 would too. For other platforms I just don't know. There appears to be a huge range of actual proposed features, but these features (other than the above) are some ways away from widespread adoption, it seems. I'd be interested to see what the views are on the approach I'm proposing, that is to take the above subset of features and begin applying them in my work.
  8. Boost's undefined references

    I've archived both the bind, thread, and posix_time libraries in one static library under windows. The release boost archive was 395k which is much larger than just the threads library alone. I'm pretty sure that bind is required, and date_time would be needed for the this_thread::sleep() function. Anyway, I've written a template library wrapper for these things with some typedefs to make life easier. An example of the code for a sleeping boost thread follows using all three libraries: #include <boost/bind.hpp> #include <boost/thread.hpp> #include <boost/date_time.hpp> // optional: hours(),minutes(),seconds() milliseconds() int time; boost::this_thread::sleep( boost::posix_time::minutes( time ) ); This **should** work on both Vista and Fedora. For the Vista system, I'm using code::blocks, mingw, and gcc, but it's a much older version of gcc; MinGW 5.1.6 and GCC 3.4.5. That's old. Boost version looks like 1.40. That's old too. I'm using boost 1.44 under Fedora with GCC 4.4.4.
  9. Boost's undefined references

    That's very strange. I use Fedora for almost all my development work, but I have used Windows Vista for testing purposes, and I'm certain that boost::threads worked for me. I'll have a look at the set up...I'm assuming you are using Vista or 7? Can you use C++0x? There is reportedly a native thread library built in. I haven't tried it yet. Instructional video is here: http://www.youtube.com/watch?v=ys4NjnSyzkY
  10. C++0x Opinions: ready to be used in projects?

    This is great information. Sounds like it is ready for use, but perhaps it is best to use a subset of features first. Perhaps r-values, lambda and auto (although it does seem strange for a strictly-typed language paradigm). In your experience, where would you suggest one go for tutorials? From the comments I gather that it's not just the mechanics that need to be learned, but the conceptual aspects too. It could change the way that C++ is used. It kind of reminds me of the C++ evolution from 'is-a' to 'has-a' thinking (ie inheritance v composition). Also, has anyone experience of native threads, and are they portable? [Edited by - random_thinker on November 5, 2010 5:58:24 AM]
  11. C++0x Opinions: ready to be used in projects?

    Sounds as though a lot of developers are already using it. Any significant projects based upon C++0x yet?
  12. Boost's undefined references

    I don't see anything that is really wrong with your code. Have you tried setting the compiler flag: --enable-auto-import as the warnings suggest? Other suggestions: #include <windows.h> in main; exposes the windows threading api. Some other possible header includes: <stdafx.h> <windows.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> Pthread.h and pthreads for windows are only useful for certain versions. I don't think that Vista and 7 are included. #include <Pthread.h> // optional, need ms pthreads library see below. More information at http://technet.microsoft.com/en-us/library/bb463209.aspx concerning pthreads and windows. You can download windows services for Unix here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=896C9688-601B-44F1-81A4-02878FF11778&displaylang=en This is an extreme fall back position: In the extreme; have you tried the linker flag -lpthread or -pthread in code::blocks? You can get a pthreads-w32.dll at sourceware.org. (sourceware.org/pthreads-win32/). [Edited by - random_thinker on November 4, 2010 9:51:03 AM]
  13. C++0x Opinions: ready to be used in projects?

    I doubt that I will be devloping for consoles any time soon, but I do want my code to be as portable as possible. I'm not entirely convinced that the new features are really all that dramatic; much of what is available in C++0x could probably be done in boost or with a work around of some kind. Is it just there at the moment for testing purposes? Is anybody using it for serious development?
  14. I tend to use GCC (4.4.1 at the moment) exclusively in my work. I'm just looking for feedback from the pros; should I consider using C++0x for my projects, or should I wait a bit longer. I can see the advantages in terms of functionality. Just wondering the pros and cons and whether it is viable yet...
  15. Boost's undefined references

    It might not be associated with codeblocks, it could be the latest version of GCC. I'm not sure. The current versions I'm using are: GCC: 4.4.4 20100630 (Red Hat 4.4.4-10) Code::Blocks: 10.05 The above combination does not offer any multi-threaded compiler settings; ie no need to set them. My older system had an extensive list, and it was quite tricky to set up.
  • Advertisement