Author Topic: PCH file of sdk.h under Windows  (Read 7570 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
PCH file of sdk.h under Windows
« on: August 12, 2013, 03:41:06 am »
Hi, jens, I think this commit broken Windows build.

Code
 src/CodeBlocks.cbp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/CodeBlocks.cbp b/src/CodeBlocks.cbp
index 1f6835d..f519b7c 100644
--- a/src/CodeBlocks.cbp
+++ b/src/CodeBlocks.cbp
@@ -1261,7 +1261,7 @@
  <Unit filename="include/sdk.h">
  <Option compile="1" />
  <Option weight="1" />
- <Option target="src" />
+ <Option target="sdk" />
  </Unit>
  <Unit filename="include/sdk_common.h">
  <Option target="sdk" />

Under Windows, there are different PCH files.
sdk.h.gch is used for src target and all the plugins
sdk_precomp.h.gch is used for sdk target only

When building the current SVN trunk, I see a log of warnings:
Code
-------------- Build: src in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler)---------------

[  3.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -iquote.objs\include -I.objs\include -I. -IE:\code\cb\wx\wxWidgets-2.8.12\include -IE:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c F:\cb_sf_git\trunk\src\src\app.cpp -o .objs\src\app.o
F:\cb_sf_git\trunk\src\src\app.cpp:10:17: warning: .objs\include/sdk.h.gch: not used because `EXPORT_LIB' not defined [-Winvalid-pch]
...

I see that both sdk.h.gch and sdk_precomp.h.gch are generated when building sdk target.

If I delete the two gch files, and try to build the src target, there is no warnings, which means the src target is building without the pch file support.

But I think: sdk.h.gch should be generated in the first step of building src target.
Code
-------------- Build: src in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler)---------------

[  2.7%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -iquote.objs\include -I.objs\include -I. -IE:\code\cb\wx\wxWidgets-2.8.12\include -IE:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c F:\cb_sf_git\trunk\src\include\sdk.h -o .objs\include\sdk.h.gch
[  5.4%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DBUILDING_PLUGIN -iquote.objs\include -I.objs\include -I. -IE:\code\cb\wx\wxWidgets-2.8.12\include -IE:\code\cb\wx\wxWidgets-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c F:\cb_sf_git\trunk\src\src\app.cpp -o .objs\src\app.o

Any ideas? I think the commit above should be reverted for Windows cbp.

Thanks.
« Last Edit: August 12, 2013, 03:45:18 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline sorinev

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: PCH file of sdk.h under Windows
« Reply #1 on: August 14, 2013, 10:56:05 am »
Does this have anything to do with my svn only showing 9248 when C::B is started up, even though my checkout directory is up to date at 9251? I'm on Windows.

When doing a clean build, I got that error too. 114 instances of it.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: PCH file of sdk.h under Windows
« Reply #2 on: August 14, 2013, 02:12:16 pm »
Any ideas? I think the commit above should be reverted for Windows cbp.
This specific part for the Windows projects: Yes. I just stumbled across this myself.
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: PCH file of sdk.h under Windows
« Reply #3 on: August 14, 2013, 03:29:56 pm »
Any ideas? I think the commit above should be reverted for Windows cbp.
This specific part for the Windows projects: Yes. I just stumbled across this myself.
It should either be reverted or fixed in an  other way.
I can not do it myself at the moment (not at home since monday, probably later the next night, too much work).

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: PCH file of sdk.h under Windows
« Reply #4 on: August 17, 2013, 03:08:26 pm »
Someone, already patched it.
« Last Edit: August 17, 2013, 03:45:57 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org