User forums > Using Code::Blocks

please commiserate with my pain

(1/2) > >>

insolence:
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.

Biplab:

--- Quote from: insolence 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.

--- End quote ---

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.



--- Quote from: insolence on September 21, 2007, 10:09:45 pm ---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.

--- End quote ---

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.

insolence:
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.)

Blue-Tiger:
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.

Biplab:

--- Quote from: insolence on September 22, 2007, 07:22:20 am ---(Further, I never meant to insinuate that codeblocks was the cause of any trouble.  It was unexpected that my post implied this to you.)

--- End quote ---

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


--- Quote from: insolence on September 22, 2007, 07:22:20 am ---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?

--- End quote ---

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. :)

Navigation

[0] Message Index

[#] Next page

Go to full version