Bug #7796 2006-06-08 16:57

loicp

Backticks aren't expanded using 2nd PCH strategy

I'm trying to compile a wxwidgets based program.

So I added to the linker options `wx-config --libs` and to the compiler options `wx-config --cppflags`

When I try to compile it, I have the folllowing error :

-------------- Build: Release in importcsv ---------------

g++ -Wall `wx-config --cppflags` -O2 -s -I- -I. -c importcsv.cpp -o obj/Release/importcsv.o

cc1plus: note: obsolete option -I- used, please use -iquote instead

importcsv.cpp:1:23: erreur: wx/wxprec.h : No such file or directory

Dans le fichier inclus à partir de importcsv.cpp:9:

./mainframe.h:4:19: erreur: wx/wx.h : No such file or directory

Process terminated with status 1 (0 minutes, 3 seconds)

2 errors, 0 warnings

Backticks don't seem to be expanded.

Running g++ -o foo foo.cpp `wx-config --libs --cppflags` from the command line works fine.

I found on the forum this post, which solved my problem :

http://forums.codeblocks.org/index.php?topic=2323.msg18907#msg18907

I had to go to "Project->Properties" and select the first option for PCH mode, and now it compiles :

g++ -Wall `wx-config --cppflags` -O2 -s -c importcsv.cpp -o obj/Release/importcsv.o

g++ -Wall `wx-config --cppflags` -O2 -s -c mainframe.cpp -o obj/Release/mainframe.o

g++ -o bin/Release/importcsv obj/Release/importcsv.o obj/Release/mainframe.o `wx-config --libs`

Process terminated with status 0 (0 minutes, 9 seconds)

0 errors, 0 warnings

Only the second PCH strategy doesn't work, first and third one are working.

-Linux x86 running Ubuntu Dapper Drake

-build: Jun 5 2006, 21:13:24 - wx2.6.1 (Linux, unicode)

-libwxgtk-2.6.1

Searching on open bugs reports for PCH or backticks doesn't return me something.

Category
Compiler
Group
 
Status
Closed
Close date
2011-02-24 05:46
Assigned to
mortenmacfly
mandrav 2006-09-08 11:41

Does this bug still persist?

rickg22 2007-07-20 05:26

Does this bug still persist?

mortenmacfly 2007-12-17 14:05

This bug still persists here on Ubuntu 7/10 with wxWidgets 2.8.7 / C::B SVN head from 17 Dec. 2007.

Issue is exactly as reported: For newer GCC compilers the -I- switch is wrong. This results in "earlier" include directories (the wx ones) being omitted. Thus the compilation fails.

How to resolve? Using the compiler version query API (by Biplab) the *right* -iquote switch should be used for GCC 4.x.x. for GCC 3.4.x still -I- applies (IMHO).

mortenmacfly 2007-12-17 14:17

Also see Bug #12610 and Bug #10624 (they have been closed as these are duplicates).

mortenmacfly 2009-10-24 18:28

This bug is now fixed in HEAD.

Thank you for reporting it.