Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 08 Aug 2000
Offline Last Active Today, 05:42 AM

#5206878 Some programmers actually hate OOP languages? WHAT?!

Posted by BitMaster on 27 January 2015 - 03:40 AM

a lot of text

I had a bit of déjà vu when I read that and after going back through your old threads I learned why. Back in 2012 you made a thread that's very similar: extremely low on facts but lots of strong opinions, tons of pathos and a good dosage of completely wrong. And the same religious prosecution reference.
My personal advice would be to drop that religious prosecution stuff first. It just screams "nutcase". Unless you really actually believe it. In that case I would advise professional help.

I was pondering for a bit whether I should try to talk about whatever facts (or supposed facts) I could find in your posts but then decided against it. There is so much hyperbole and pathos in it, I really don't want to read it a second time in the hope of finding something to work with. Besides, I'm fairly certain the bug I was hunting is fixed now and I just won't have the time while I wait for my processing step to run through.

#5206472 how to install external libraries on codeblocks

Posted by BitMaster on 24 January 2015 - 04:57 PM

Offhand, I'd say to make sure you're linking in the correct order (i.e. graphics, window, then system). Make sure you're setting things either globally, or make sure you're linking and compiling in the same mode (debug or release).

That's a runtime error, not a linker error. Linking sequence won't have an effect under normal circumstances.

If you're trying to link statically, I'd recommend trying to get it up and running dynamically first, as static with sfml gets a little awkward as you need to link all the dependencies and include things with your project, amongst other things.

According to the screenshot he is already linking dynamically. Granted, it would be better if he described what exactly he was doing instead of posting a single screen shot and then letting people guess, but the problem appears to be a symbol not being found in one of SFML's DLLs.

Lastly, you may want to build sfml yourself, if you're doing absolutely everything else correctly. I don't mean to complicate things further, but it's possible there are minor things keeping it from working for you that aren't due to user error (newer/older version of codeblocks, your version of gcc, etc, etc).

Here I can agree with. The error looks weird but without further information my guess would be a name mangling issue. Especially with MinGW having the library precompiled for your exact flavor of the compiler is important (there are up to three different exception models for Windows and two big different runtimes you might be using).
Additionally my personal advise would be to start learning C++ with one of the MSVC Express editions when you are working on Windows to begin with. It's far easier to get working, precompiled binaries for most common libraries for that compiler. Using MinGW will in most cases require you to compile the libraries you need yourself. That is not a bad thing at all, but when you are starting out that's not something I recommend dealing with as well as everything else.

#5206410 how to install external libraries on codeblocks

Posted by BitMaster on 24 January 2015 - 11:24 AM

i've tried the exact same steps but still got an error

Here is an important lesson to learn: saying "I get an error" makes it practically impossible for people to help you. The error contains a lot more detail than just its presence. The text that is part of the error might not mean anything to you yet but without it no one can really help you.

#5205578 c++ Heap corruption w/ std::vector

Posted by BitMaster on 20 January 2015 - 11:44 AM

It should be noted that using an std::array<> would probably have caught the error earlier in this case since most implementations will assert in operator[] regarding the validity of the index (without sacrificing speed or space in non-debug builds).

Apart from that, writing beyond the array boundaries is always nasty to debug. If you have your code in some kind of version control system (a good advice in all cases), going back and checking when these errors stop appearing can give clues. Otherwise commenting out bits of code can give clues as well.

Edit: but the best course of action is avoiding situations like this entirely. As above, the std::array<> would have caught the problem, unlike the C style array. If you need a dynamic size, std::vector with the desired size passed to the constructor can work too. If you only access it via operator [] it will assert on bad indices as well and not grow automatically.

#5205564 c++ Heap corruption w/ std::vector

Posted by BitMaster on 20 January 2015 - 10:11 AM

The problem is most likely unrelated to std::vector. Maybe someone is writing beyond array boundaries somewhere (and thereby threshing the memory belong to the std::vector) or maybe you are working with a vector inside an object which has been deleted or went out of scope. The best approach (on MSVC) would be to switch to a Debug build and start it with the debugger. Ideally one of the several additional checks running there will trigger an assert closer to the point where crap actually happens.

#5205497 100% New to Game Deving... 0% Idea Where to Start

Posted by BitMaster on 20 January 2015 - 03:22 AM

COLllin, considering how extremely starting out you are yourself you might want to consider laying off trying to give others advise for the time being.

#5205036 Problem with SDL

Posted by BitMaster on 18 January 2015 - 02:40 AM

First minor issue: You shouldn't start your variable names with an underscore. Variable names starting with underscores are reserved for the compiler.

That is incorrect like that. According to this post which reinforces my previous suspicion, his use of underscores is without issues. He is using a single underscore followed by a lower case letter which the standard allows him to.
I'm not a fan of that notation but those are stylistic complains, not technical. I am however rather annoyed whenever I see (void) as a function parameter. The code is obviously C++, could never be C, so there is absolutely no point in putting that there.

#5204522 100% New to Game Deving... 0% Idea Where to Start

Posted by BitMaster on 15 January 2015 - 12:04 PM

Considering your writing background you might also want to consider the field of interactive fiction where several solutions exist, for example Inform.

#5203868 Memory File Mapping?

Posted by BitMaster on 13 January 2015 - 03:47 AM

This should be the current documentation of boost::mapped_file. Although Google is sometimes a bit uncooperative there I don't think a documentation that is 19 releases behind is ideal.

#5203421 Very simple linking issue

Posted by BitMaster on 11 January 2015 - 03:12 AM

I'm doing this at work all the time with CMake across a project containing dozens of internal libraries and never had a problem. CMake correctly pulls in dependent libraries (even subdependencies only specified by the dependencies themselves some way down the line).

You appear to create a pure C library and then link it to a C++ program. That is not going to work, with or without CMake. Make the library a .cpp to make CMake auto-pick C++, force it to do that some other way or create a correct extern "C" wrapper in the include file.

Edit: Also, I would strongly recommend not to use FILE GLOBs to specify the implementation files to be added to a project. I'm guilty of that in my work project (but only for headers) since CMake was introduced later and there was never time to do it properly afterwards but a new project should not start that in your own interest.
I'm also not a fan a having another PROJECT() statement in a sub-CMakeLists (especially since it is dependent on stuff outside the subdirectory).

Edit 2: I'm also a bit miffed that after as little time as an hour you decided to reach the statement "CMake sucks" and calling it "crap", especially since it's pretty clear the problem it the user, not the tool. That is rather beginner behavior.

#5203418 About computer instruction in relation to RAM consumption

Posted by BitMaster on 11 January 2015 - 02:54 AM

What determines who can and can’t see them? Rating? Crossbones? Duration on the site?

To my knowledge once you cross a thousand reputation, you can see the votes.

For the record, I “undid” one of the original poster’s down-votes because intentions matter.
Yes, it was something of a terrible question, but it was legitimate. We punish people for intentionally being obnoxious, not for sincerely seeking help.

I also agree that the original poster could have answered some of these questions on his or her own via Google, but then again question #6 indicates the original poster was perhaps confused (to put it mildly), which is understandable when you literally have no scope of the details of the question you want to ask.

I'd like to respond to that a bit. warnexus' problem is that practically all of the threads I have read follow the same pattern also observed here. The majority of questions could be answered by quickly doing a search regarding it and reflecting for a few moments about it. Other questions suggest this important step has not been done for important prerequisites of the question.

Up to this thread I was more inclined to believe that it's just a person who seriously needs to work on the way he deals with problems and questions. Asking questions is good, but only after spending some time working on a problem. I often had the distinct impression he had completely outsourced thinking to this forum and probably other places.
However, after reading his point (6) above I decided I finally had to reevaluate my internal mapping. Personally I now consider it more likely that I'm trolled instead.

#5203095 Digital Tutors

Posted by BitMaster on 09 January 2015 - 09:29 AM

Is there are special reason why you feel the need to post so many of your thread titles in ALL CAPS?

#5202788 FBO Attachments and Rendering to a Texture

Posted by BitMaster on 08 January 2015 - 04:03 AM

This page should explain things. In a nutshell: it is often more efficient for the hardware to render to render buffers instead of textures. You cannot sample render buffers as input for a following shader stage though.

#5202604 Adding third party libraries to version control

Posted by BitMaster on 07 January 2015 - 09:01 AM

I don't agree with braindigitalis. What happens when the current version of the external project does not build with your program anymore? If that happens incrementally during development, it's a minor annoyance (unless it's before an important deadline, then it's a huge annoyance). But what if you have to come back after a year or two to fix a bug? There can be a lot of changes in your 3rd party dependencies happening during that time. Worse, things might build but not work as intended (worst case, something that won't be noticed without a lot of testing). Where exactly is the problem coming from then?

At work, I'm depending on a lot of libraries, some of them very complex to build. Unless there is a very compelling reason (vulnerabilities, critical features, ...), libraries do not get updated just for fun and everyone uses the same library directory. Everyone uses the same (Windows) build system as well. Even something as 'simple' as moving from one version of MSVC to the next is a huge operation that is not started lightly. Interestingly enough that is much simpler for all parts of the project which build under Linux.

At home I'm moving towards putting dependencies into my repository (but clearly marked as 3rd party) and integrating them into my CMake build system there (very simple for some libraries, not so much for others). Begin edit: I still don't add the 3rd parties repositories here. Updates only happen when I decide I have the time to deal with it. End edit.

If you obtained the libraries via SVN, you can just SVN export them into your source tree and then add them again into your own SVN.

#5202535 Silly question about classes/libraries/headers

Posted by BitMaster on 07 January 2015 - 03:18 AM

I'm not sure I get what you are asking. Do you believe everything you write has to be in a class for the sole purpose of being in a class? It does not, it should not. Classes are a tool. Free functions are tool. Several other things are a tool. The hallmark of a good programmer is picking the right tool for the right job.

For example std::tuple is a (template) class and there is a very useful free function right next to it: std::make_tuple. Since template argument deduction works on free functions but never on classes that can be extremely convenient.
At the same time free function like std::sort exist as well.