Code::Blocks Forums
User forums => Help => Topic started by: DreamBliss on February 12, 2014, 04:31:45 am
-
OK, so I have the latest build of Code::Blocks running on a Windows 7 64bit machine.
I have created a package called AllCode that has what you need in it to compile and run DirectX, OpenGL and WindowsSDK programs. Originally it was all together in two directories: Include and Lib. Now it is three folders, DirectX, OpenGL, WindowsSDK, and in each is the Include and Lib folders containing the files from these libraries.
AllCode exists to be the end-all solution so you can pick any book up off the shelf from the last few decades and compile and run the code. You must understand this point. It is VITALLY important that I am able to set Code::Blocks up to compile and run this code, and that I never, ever, under any circumstances, have to deal with errors related in any way to Code:Blocks not finding the DirectX, OpenGL or WindowsSDK files it needs! I simply do not want to fight and struggle with getting something to compile and run.
With that said I need to understand the Gobal Compiler Settings, as well the related Project/Build Settings. I found nothing in the manual, the wiki or in Googling. I specifically need to know the following:
1. Under Global Compiler Settings/Search Directories what, exactly and in great detail, goes into the Compiler, Linker and Resource Compiler tabs?
2. Under Project Build Options/Search Directories what, exactly and in great detail, goes into the Compiler, Linker and Resource Compiler tabs?
3. What, exactly and in great detail, is the best way to point Code::Blocks to my AllCode directory, so that it always, without fail, finds any DirectX, OpenGL or WindowsSDK files it needs?
4. How to I set Code:Blocks to Multibyte or Unicode as needed, both Globally and Project?
I do apologize for my attitude here. I thought I had this figured out, and everything set up, but I discovered today that I didn't. It is very frustrating. Everyone says that I am supposed to get to know my IDE. But, as far as I know, there is no tutorial series that covers Code::Blocks, and nothing else, in great detail. So how am I supposed to become intimately familiar with my IDE when there is so much I don't understand and so little information regarding it? On top of that, I am trying to develop my C++ programming knowledge. How am I supposed to learn the complexities of Code::Blocks and C++ at the same time? Either one of these subjects is hard enough by itself!
So I really do appreciate your help in this matter, and my thanks go out to the Code::Blocks team for making such a wonderful tool. I can only hope someone, someday, feels compelled to do a video tutorial covering all of its aspects.
-
OK, so I have the latest build of Code::Blocks running on a Windows 7 64bit machine.
You did not say anything about what version or compiler you are going to use, so I am answering general and it will hopefully work (the things is, I have no idea if that "AllCode" supports your target compiler):
- all include folder go to project build options -> compiler include directories
- all lib folders go to project build options -> linker include directories
- all required #defines go to project build options -> compiler #defines
- all required libs to link against go to project build options -> linker -> link libs (careful: the order matters here!)
You should consult the Code::Blocks manual for general instructions. There is no general rule that will always work - you need to consult the documentation of the SDK's to know, what libs to link against, for example. The reason is that it heavily depends on what you are actually implementing. However, you can use the project wizards that ship with Code::Blocks to generate (i.e.) a Direct/X stub for you.
In general: I strongly suggest you don't start with "general problem solver collective libs" because this is usually grab and very error prone for beginners (although they might state differently). Start from scratch and extend you framework only with the libs you need exactly for you compiler and intended target platform. Also, reading books about basics of the development of Direct/X, OpenGL or WindowsSDK apps is a must. This is not an easy things one can just start with, sorry.
-
I am using MinGW for my compiler, the latest build of Code::Blocks minGW version.
I have no Project/Build Options/Compiler Include Directories. So I am not sure what you mean by that. I have:
Project/Build Options/Compiler Settings
Project/Build Options/Linker Settings
Project/Build Options/Search Directories
Project/Build Options/Pre/post Build Steps
Project/Build Options/Custom Variables
Project/Build Options/Make Commands
I also have much the same in Settings/Compiler in the Global Compiler Settings box.
Why do I need to know about #defines? Was this an answer to something I asked? It is not immediately apparent.
I also have no link libs. I have what I stated above.
So I have to guess at what you are trying to tell me here. I am assuming you mean the Search Directories tab. Under that I have the Compiler and Linker tabs, along with the Resource Compiler, and I still don't know what that is. If my assumption is correct I place the include directories in the Compiler section, and the lib directories in the Linker section.
Do I have that right? Now do I have to list all the individual files as well in Linker Settings/Link Libraries, or is placing the directories enough?
Also do I have to this every single time under project settings? Will it fail if set globally? Or is there some reason I shouldn't set things globally?
Thank you for the advice.