Author Topic: please commiserate with my pain  (Read 5866 times)

insolence

  • Guest
please commiserate with my pain
« on: September 21, 2007, 10:09:45 pm »
So I used codeblocks a long time ago a bit and I've been busy but I thought recently to download it again and try to maybe contribute to some open source project.  (This is on windows.)  I get it all setup, I download MinGW, I assign what I think are the proper search directories for the project, I'm trying to create a new codeblocks project from scratch for a particular source package.  Then I get these weird errors, syntax error before a particular declaration.  I think the declaration is bad, and mess with the search directories.  Then I figure that the declaration is fine, but the syntax error maybe refers to something in a previous file.  I'm totally confused.  Eventually, I try building different files on their own to try and isolate the problem and then I get the giant "can't find 'config.h'", which I know has to be created by a configure script that I can't run right now in windows.  And I'm sure if I spent hours setting up all the other windows pseudo linux programs, I could run that configure script or convert it or something, or I could configure the source on a linux computer and then copy it over and change entries in config.h line by line until it works.

But at this point I figure there's much better things to do and give up in disgrace.

Is it this difficult for everyone?  I've been programming for years and years and this kind of stuff always makes me feel worthless.  I know how all the code works together, given enough time and motivation, I could write a compiler.  So I feel like I'm not lacking in technical skill.  But its always these configuration details and setting up projects, and knowing what all the little caveats of each system is that really stumps me.  Am I an idiot?  Am I just making it too hard for myself?  Are there people who can just download a random source package and make it compile for codeblocks on windows instantly?  Everything just always seems like its way more trouble than its worth.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: please commiserate with my pain
« Reply #1 on: September 22, 2007, 05:51:41 am »
So I used codeblocks a long time ago a bit and I've been busy but I thought recently to download it again and try to maybe contribute to some open source project.  (This is on windows.)  I get it all setup, I download MinGW, I assign what I think are the proper search directories for the project, I'm trying to create a new codeblocks project from scratch for a particular source package.  Then I get these weird errors, syntax error before a particular declaration.  I think the declaration is bad, and mess with the search directories.  Then I figure that the declaration is fine, but the syntax error maybe refers to something in a previous file.  I'm totally confused.  Eventually, I try building different files on their own to try and isolate the problem and then I get the giant "can't find 'config.h'", which I know has to be created by a configure script that I can't run right now in windows.  And I'm sure if I spent hours setting up all the other windows pseudo linux programs, I could run that configure script or convert it or something, or I could configure the source on a linux computer and then copy it over and change entries in config.h line by line until it works.

Install MSYS from MinGW site. Then run configure script in MSYS shell which will generate the config.h file. And then compile it in MSYS shell.

Generating a config.h on Linux and then manually editing them till it works is not a good choice. There could be some POSIX functions which are unavailable on Windows. Configure script will do the job of handling such cases.


Is it this difficult for everyone?  I've been programming for years and years and this kind of stuff always makes me feel worthless.  I know how all the code works together, given enough time and motivation, I could write a compiler.  So I feel like I'm not lacking in technical skill.  But its always these configuration details and setting up projects, and knowing what all the little caveats of each system is that really stumps me.  Am I an idiot?  Am I just making it too hard for myself?  Are there people who can just download a random source package and make it compile for codeblocks on windows instantly?  Everything just always seems like its way more trouble than its worth.

If you use the right tool for compiling it's not that difficult. Code::Blocks is an IDE which will compile your source provided you use proper compiler, proper compiler options. It's not a magic tool which will do all of them automagically.

You just can't compile any random source on Windows. It depends whether it's compilable at all or not. If it uses some functions which are exclusively present on Linux, then you can't compile unless you use Cygwin or similar emulation tools.

In short, Code::Blocks is not the cause of your bad experience in compiling that source.
Be a part of the solution, not a part of the problem.

insolence

  • Guest
Re: please commiserate with my pain
« Reply #2 on: September 22, 2007, 07:22:20 am »
Thank you for your advice on MSYS.  Also, I am fully aware that the source needs to be compatible with windows and the source I am trying to compile is.

My general annoyance is with the fact that there's always something like MSYS that one has to know about even after one knows the caveats of the compiler.   If I needed specific help I would have posted this in the help section but thank you anyway.

More specifically, I was just wondering if anyone else gets annoyed at all the different things that can go wrong separate from the programming itself.  I'm not saying that its not doable, I'm just saying its frustrating and I'm wondering if anyone else has ever been frustrated with this kind of thing.  Its just a general wish that things could be a little simpler and one could spend more time coding and less time messing with operating systems and setups.  Anyone?

(Further, I never meant to insinuate that codeblocks was the cause of any trouble.  It was unexpected that my post implied this to you.)

Offline Blue-Tiger

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: please commiserate with my pain
« Reply #3 on: September 22, 2007, 01:11:38 pm »
Well, I struggled with these things for quite a while, and sometimes still do.  But once you settle on a Compiler and/or development plattform and get used to it, things ease up. When I first switched from MSVC to a MinGW-Environment (or from Windows to Linux), everything was hard and difficult, because I lacked

a) deeper knowledge of the programming language (e.g. I didn't know the difference between "#include<foo.h>" and "#include"foo.h"".
b) knowledge of how the compiling process works (e.g. I didn't know what include-directories where)
c) knowledge of the "linux-way" (e.g. I didn't know what .configure && make && make install meant)

But once I knew these things and wrote my first few makefiles it all started to make a lot of sense, and nowadays I usually don't have any trouble compiling the libraries I work with. Of course, when a big and complicated build-process is involved I stumble into problems now and then, but usually these monsters come with some documentation telling you how to handle things.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: please commiserate with my pain
« Reply #4 on: September 22, 2007, 02:00:36 pm »
(Further, I never meant to insinuate that codeblocks was the cause of any trouble.  It was unexpected that my post implied this to you.)

I may have missed the essence of your post. But my post was not to hurt you; rather was to defend C::B. ;)

My general annoyance is with the fact that there's always something like MSYS that one has to know about even after one knows the caveats of the compiler.   If I needed specific help I would have posted this in the help section but thank you anyway.

More specifically, I was just wondering if anyone else gets annoyed at all the different things that can go wrong separate from the programming itself.  I'm not saying that its not doable, I'm just saying its frustrating and I'm wondering if anyone else has ever been frustrated with this kind of thing.  Its just a general wish that things could be a little simpler and one could spend more time coding and less time messing with operating systems and setups.  Anyone?

I agree with you on this. There are several other problems which programmers need to handle. Packaging on Linux is another example. Some distributions uses rpm, some uses deb format and some uses tgz. Similarly a programmer can not expect the same code to be compiled with different compilers without emitting a warning. E.g., some older C functions have been replaced with safe C-functions in MSVC8. So if you are using any such code, you are bound to get some warnings even though your code is ok. There are even more examples available; but I don't want to lengthen this. :)
Be a part of the solution, not a part of the problem.

insolence

  • Guest
Re: please commiserate with my pain
« Reply #5 on: September 22, 2007, 09:29:39 pm »
Thanks.  Yeah, those are definitely some of the major annoyances.  I actually started on Codewarrior for Mac OS pre- X, and then went to linux, and then went to codewarrior for windows.

But yeah, it seems like configure scripts are more complicated and less flexible and powerful than they need to be.  Certainly all the system information gathered can be used by a program to optimize itself or ensure that it works.  But I tend to think configure is a script that's been kludged onto and kludged onto over the years.  I shouldn't talk about it as I really don't know much about it, but I do know that it checks for all kinds of things that the program doesn't use and I also know that its not a sure think that its going to detect that you've got the right software.  I know in the past I've commented out parts of configure scripts and gotten software to compile from it though I know that's not a good idea.

And what about all the glib-config, pkg-config stuff.  That's sort of an admission that configure doesn't do all it should, but instead of fixing configure, there's a new set of issues added to the whole problem, at least for gtk related libraries and some other gnome stuff.  I know I've had pkg-config all set up and some configure script has looked for something through an obsolete glib-config utility and caused me another headache.

And yes, the packaging on linux.  Its great that we can download software packages just for our own distribution out of the many out there.  But they're all linux.  Its like instead of trying to solve root issues that result in software incompatibility between different distributions, the distributions instead offer packages of tested software specific to their setup.  Its not horrible, but shouldn't a piece of software on one distribution of linux run on another without special considerations?  My main annoyance with this is that when everything works, its fine.  But if anything doesn't work, everyone is so used to the distributions, that no one knows why there's a problem, and if you ask around people say, "well, you should have used the package management system, don't ask us."

I wish some of the major groups, like gtk, would stabilize their group of libraries for all systems.  Its just seemed like I've had a lot of problems with that stuff.

Ack, I'm rambling.