Author Topic: Code::Blocks Project Dosen't Work Correctly  (Read 4406 times)

Offline kittyhacker101

  • Single posting newcomer
  • *
  • Posts: 5
Code::Blocks Project Dosen't Work Correctly
« on: August 25, 2015, 03:41:05 am »
I have a project that I am working on in Code::Blocks (It's for a DLL File) and It won't compile correctly.
Code::Blocks says that a file that is in the project dosen't exist.
I am running Code::Blocks 13.12.

Note : I Replaced the name of the project and file extentions with # for privacy purposes.
Note : The file ntoskrnl.h exists, and is in the project. This is what I was talking about.

Build Log :
-------------- Build: Release in # (compiler: GNU GCC Compiler)---------------

[  0.3%] mingw32-gcc.exe -fexpensive-optimizations -O3 -DBUILD_DLL -fexpensive-optimizations -O3 -I..\..\..\Source -I..\..\..\Source -c #Source\Kernel\cache\cachesub.c -o output\Source\Kernel\cache\cachesub.c.o
[  0.5%] mingw32-gcc.exe -fexpensive-optimizations -O3 -DBUILD_DLL -fexpensive-optimizations -O3 -I..\..\..\Source -I..\..\..\Source -c #\Source\Kernel\cache\copysup.c -o output\Source\Kernel\cache\copysup.c.o
[  0.8%] mingw32-gcc.exe -fexpensive-optimizations -O3 -DBUILD_DLL -fexpensive-optimizations -O3 -I..\..\..\Source -I..\..\..\Source -c #\Source\Kernel\cache\fssup.c -o output\Source\Kernel\cache\fssup.c.o
[  1.1%] mingw32-gcc.exe -fexpensive-optimizations -O3 -DBUILD_DLL -fexpensive-optimizations -O3 -I..\..\..\Source -I..\..\..\Source - #\Source\Kernel\cache\lazyrite.c -o output\Source\Kernel\cache\lazyrite.c.o
[  1.4%] mingw32-gcc.exe -fexpensive-optimizations -O3 -DBUILD_DLL -fexpensive-optimizations -O3 -I..\..\..\Source -I..\..\..\Source -c #\Source\Kernel\cache\logsup.c -o output\Source\Kernel\cache\logsup.c.o
#\Source\Kernel\cache\cachesub.c:12:22: fatal error: ntoskrnl.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minute(s), 1 second(s))
 
#\Source\Kernel\cache\copysup.c:11:22: fatal error: ntoskrnl.h: No such file or directory  ???
#\Source\Kernel\cache\fssup.c:12:22: fatal error: ntoskrnl.h: No such file or directory
#\Source\Kernel\cache\lazyrite.c:11:22: fatal error: ntoskrnl.h: No such file or directory
compilation terminated.  :o
Process terminated with status 1 (0 minute(s), 1 second(s))
 
compilation terminated.
Process terminated with status 1 (0 minute(s), 1 second(s))
 
compilation terminated.
Process terminated with status 1 (0 minute(s), 1 second(s))
 
#\Source\Kernel\cache\logsup.c:11:22: fatal error: ntoskrnl.h: No such file or directory  ???
compilation terminated.
Process terminated with status 1 (0 minute(s), 1 second(s))
5 error(s), 0 warning(s) (0 minute(s), 1 second(s))  >:(

Please Help!
 

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #1 on: August 25, 2015, 07:09:08 am »
Code::Blocks says that a file that is in the project dosen't exist.
Its not C::B that "says" that, its the compiler. The compiler is usually always right, so it must be something about your project settings and not C::B.

Note : The file ntoskrnl.h exists, and is in the project. This is what I was talking about.
You are missing programming basics: The compiler needs to know where to look for the include files. Please adjust your project settings by adding the path to ntoskrnl.h to the compiler include paths.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline kittyhacker101

  • Single posting newcomer
  • *
  • Posts: 5
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #2 on: August 25, 2015, 07:27:50 am »
I added to the search paths, and it still dosen't work.  ???

« Last Edit: August 25, 2015, 07:31:16 am by kittyhacker101 »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #3 on: August 25, 2015, 08:15:06 am »
I added to the search paths, and it still dosen't work.  ???
Is the file "ntoskrnl.h" exactly in the path "D:\OneDrive\Backup\Desktop\KittyhackerOS"?

Please open an explorer in that path and verify. The compiler says it is not - I believe the compiler more than you... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline kittyhacker101

  • Single posting newcomer
  • *
  • Posts: 5
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #4 on: August 25, 2015, 04:14:28 pm »
The compiler dosen't look in sub directories?  ??? I guess I will have to add it to the compiler directories, once I find that file that is jumbled with 100+ source code files...

Offline kittyhacker101

  • Single posting newcomer
  • *
  • Posts: 5
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #5 on: August 25, 2015, 04:26:01 pm »
It looks like that it worked. It gave me an error for another .h file. Do I have to do this for every .h file?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #6 on: August 25, 2015, 04:30:34 pm »
It looks like that it worked. It gave me an error for another .h file. Do I have to do this for every .h file?

You have to add every directory (to CB include/header search) that is needed to find the headers.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline kittyhacker101

  • Single posting newcomer
  • *
  • Posts: 5
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #7 on: August 25, 2015, 04:58:52 pm »
This will take a while... I have 50 header files >:(

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #8 on: August 25, 2015, 08:40:40 pm »
Of course the compiler doesn't look automatically into sub folders. The reason is simple: Assume you have a header file with the same name in two sub folders. Which is the right one? The compiler cannot know. It's up to the developer to "tell" the compiler. Looks like you haven't developed much, have you?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #9 on: August 25, 2015, 10:01:05 pm »
I never had to do anything like add each include folder to Codeblocks' search settings, just added the header files to my projects.  There must be something really wrong with your compiler installation.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #10 on: August 25, 2015, 10:39:22 pm »
I never had to do anything like add each include folder to Codeblocks' search settings, just added the header files to my projects.  There must be something really wrong with your compiler installation.

Likely false.

The OP just likely have larger project than you have used.
Large projects tend to have multiple folders containing header files.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline raynebc

  • Almost regular
  • **
  • Posts: 217
Re: Code::Blocks Project Dosen't Work Correctly
« Reply #11 on: August 26, 2015, 09:28:25 am »
The project I work on all the time uses headers in 8 separate folders.  That's on top of all of the standard ones in my MinGW installation's includes directory.