Thread: Compiler dependencies. What are they?

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    206

    Smile Compiler dependencies. What are they?

    Hi as the title what are compiler dependencies?

    I have make lots basic and sample C++ programs to display things through screen which resemble command line interface. Do stuff like make arrays and functions and classes using initialisation lists. Understand C++ medium level ok now.

    I try to compile OGRE (Graphics Engine) source code with Dev C++. I hit problems even when using basic tutorial, even with code I not changed.

    I begin understand that there are some specific things called 'dependencies' which relate to each and every individual IDE. There is some issue relating between IDE and associated compiler. Never heard of this before, so knowledge is new.

    Obviously C++ is same everywhere but language beneath it is not. Different compilers make different implementations of C++.

    Seems that when I try compile project in Dev C++ OGRE source file cannot found some external file references. Appears I think that I need to load some more data called a 'dependency' into my IDE, but not understand what that 'dependency' is. Clearly I think it needed to talk to other files. Some of those files perhaps pre-compiled in another compiler so no communication possible.

    Maybe that why Dev C++ gives warnings of not found when compiling. I thus have question:

    1) WHat is a 'dependency' and how does it relate to an IDE? Seems Dev C++ has option to include more 'libraries'. Seems just including required header file into current project not enough to get source and external file to talk.

    2) Someone tell me that IDE's are all aimed to work with specific compiler's. Dev C++ use MingW. I hear also of Borland, GCC and others. Is architecture of any particular IDE aimed specific for relation to just one such compiler or can any IDE talk to any compiler?

    3) How does a 'dependency' relate to a compiler, or does 'dependency' only relate to IDE not compiler?

    I am quite confuse, seems OGRE has some things that are pre-compiled even in the source code release. Is there some way I can go into this stuff and make my own 'dependency' so my IDE can talk to OGRE files?

    I sorry I ask much but I have much confusion here. I'm sure someone here better than me can easy tell me where I am wrong.

    Thanks much

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    A dependency is anything you need, or oppositely, anything that if you don't have it the program will not compile or work correctly. So it's a very broad thing.

    In C and C++, dependencies are mostly of two types: header files and libraries. Most third party code is both. You include certain headers, and set the "include path" to find these headers, and you link with certain libraries, and set the "library path" to find the libraries.

    How you set these two things depends on your IDE or build system. But the idea is always the same.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    206

    Smile

    Oh my, that is very good help that, man thank you!

    So can I asking that if I have C++ header file available in C++ open in my IDE then a source file written in same IDE can for sure access it ok because they both can exist on same IDE?

    I think that is right. How do I set the include and library paths? This I think not done in source code yes? This is done in IDE settings is that correct?

    If so how can I tell my IDE where to look for header file. I have tried my own sample project with simple source and simple header file in same project in Dev C++ and in same project folder. Also added header file to project in Dev C++. Still could not find when compile.

    Looks like I maybe need to make settings in IDE or make my own library & include reference file and tell my IDE to access it. I am not sure which right now I am still confused.

    Can I simply use settings within my IDE to point direct at required external header file? Or do I need make some kind of reference file which IDE then points to to find external files?

    I hope you understand me. If not I'll repost in different way.

    Thanks so much

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    206

    Smile

    I have some good news. I opened my IDE and found a way to include header files through the IDE interface. Works very well now thanks. I can compile a source code file with reference to external header files without an issue. This is a big step forward thanks very much.

    I have a specific question relating to things I have seen on OGRE though, and this is my last question in this thread as all others are now answered for me.

    1) I see many references to dependencies regarding OGRE in pages like this one. They seem most strange. I still cannot understand why if you are building direct from C++ source code you cannot just compile all the OGRE specific things yourself through your chosen IDE from C++ so they can all talk to each other. Why is there such an emphasis on downloading specific 3rd party files to make it work with each specific compiler?

    Thanks again for any help offered

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    If source code is available you can always compile it yourself, of course. But libraries can have dependencies themselves, so that to compile library A you must first install library B, and maybe library B needs library C, etc... A precompiled version should be guaranteed to have all of its dependencies resolved so that you don't have to worry about it. It will also save the frustration of getting the compile to work, because you won't have to figure out all the little tricks -- somebody else already did that work for you.

    Unless you have a need to alter the source of the library, or if a precompiled version isn't already available for your environment, it's usually a lot easier to install a binary distribution.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #6
    Registered User
    Join Date
    Jan 2010
    Posts
    206

    Cool

    That's expalins everything I needed to know. If I have available all required source dependencies I can compile it all in my chosen IDE, but binary files will save much time. Thankyou that explains much, I did not understand where this 'magic' and mysterious files were from but it seems as I suspected that they are made up of source C++ files that have become IDE specific due to the compiler they were made with.

    Thanks so much for helping me understand!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  2. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  3. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  4. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  5. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM