News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Code::Blocks Project Dosen't Work Correctly

Started by kittyhacker101, August 25, 2015, 03:41:05 AM

Previous topic - Next topic

kittyhacker101

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!


MortenMacFly

Quote from: kittyhacker101 on August 25, 2015, 03:41:05 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.

Quote from: kittyhacker101 on August 25, 2015, 03:41:05 AM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

kittyhacker101

#2
I added to the search paths, and it still dosen't work.  ???


MortenMacFly

Quote from: kittyhacker101 on August 25, 2015, 07:27:50 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

kittyhacker101

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

kittyhacker101

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?

stahta01

Quote from: kittyhacker101 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?

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

kittyhacker101

This will take a while... I have 50 header files >:(

MortenMacFly

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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

raynebc

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.

stahta01

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

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

raynebc

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.