User forums > Using Code::Blocks

Code::Blocks, wxWidgets and Mac OS X

<< < (2/4) > >>

stahta01:

--- Quote from: BastiaanOlij on June 14, 2014, 01:23:45 pm ---oBFusCATed, I'll certainly ask there as well.

Any ideas why the output from wx_config is only working for the linker and not the compiler and why I had to manually copy all the flags in?

The "other options" is set to:
`../wxWidgets/build-cocoa/wx-config --cflags`

It does seem to do something as the string isn't put into the command string and like I mentioned, executing this on the command line and pasting the flags into the "other options" field works fine.
wx-config is executed properly for the linker options..  

--- End quote ---

I strongly suggest trying it with either a full path to wx-config or getting your computer to use just  `wx-config --cflags`

Tim S.

BastiaanOlij:

--- Quote from: stahta01 on June 14, 2014, 02:20:30 pm ---I strongly suggest trying it with either a full path to wx-config or getting your computer to use just  `wx-config --cflags`

--- End quote ---

As I mentioned, that is what I do, using wx-config directly only seems to work for the linker options, not for the compiler options, so ran it in the command line and pasted in the results. That made the sources compile.

Without wx-config in the linker options the errors on the linker are substantial as to be expected. With wx-configs output in the linker options I'm just stuck with the one error mentioned on top.

Cheers,

Bastiaan Olij

oBFusCATed:

--- Quote from: BastiaanOlij on June 15, 2014, 12:28:00 am ---As I mentioned, that is what I do, using wx-config directly ....

--- End quote ---
Please reread the post from stahta01. It is either you're using a relative path or you're not posting correct information!
You stated that you're using a relative path, but stahta01 suggested to use full/absolute path, please try it and report if it is not working...

p.s. keep in mind that the backtick expressions are cached for the whole C::B session, so if you've changed something in you environment it won't be reflected until you restart C::B.

BastiaanOlij:

--- Quote from: oBFusCATed on June 17, 2014, 01:59:27 am ---Please reread the post from stahta01. It is either you're using a relative path or you're not posting correct information!
You stated that you're using a relative path, but stahta01 suggested to use full/absolute path, please try it and report if it is not working...

--- End quote ---

Ah, then indeed I must not have been clear enough and my apologies (note in the previous posts I shorted some of the path names for clarity but I'll leave them as they are here).

In the compiler settings I've tried:
`../wxWidgets-3.0.0/build-cocoa-release/wx-config --cflags`

Nothing is added to the compiler command and compilation fails with numerous errors consistent with not having the correct paths and flags set.

I've tried:
`/Projects/CPP/wxWidgets-3.0.0/build-cocoa-release/wx-config --cflags`

Same thing as above.

Finally I executed the command on a command line and copied the flags into C::B:
-I/Projects/CPP/wxWidgets-3.0.0/build-cocoa-release/lib/wx/include/osx_cocoa-unicode-static-3.0 -I/Projects/CPP/wxWidgets-3.0.0/include -D_FILE_OFFSET_BITS=64 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__

And that works fine, this is also what is used in the compiler log posted above.

In the linker setting I've tried:
`../wxWidgets-3.0.0/build-cocoa-release/wx-config --libs`
and
`/Projects/CPP/wxWidgets-3.0.0/build-cocoa-release/wx-config --clibs`
and the output of this:
-L/Projects/CPP/wxWidgets-3.0.0/build-cocoa-release/lib   -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL /Projects/CPP/wxWidgets-3.0.0/build-cocoa-release/lib/libwx_osx_cocoau-3.0.a -framework WebKit -lwxregexu-3.0 -lwxtiff-3.0 -lwxjpeg-3.0 -lwxpng-3.0 -lz -lpthread -liconv

All result in the same linker command that compiles except for the aforementioned x86_64 error

So it would seem that calling wx-config from the compiler settings isn't working but calling it from the linker settings is.
Currently my build is setup to simply use the flags bypassing wx-config all together as I want to get the app to compile first and then worry about what I'm doing wrong in calling wx-config :)


--- Quote from: oBFusCATed on June 17, 2014, 01:59:27 am ---p.s. keep in mind that the backtick expressions are cached for the whole C::B session, so if you've changed something in you environment it won't be reflected until you restart C::B.

--- End quote ---
That is good to know but I have restarted C::B to ensure that is not the cause. Also checking the compiler log I can see the commands are being executed as they have been configured as far as I can tell so it must be a flag that is missing in either the compiler or the linker.

So far I've not had any usable feedback on that on the wxWidgets forum:(

Thanks for your help guys!

Cheers,

Bas


oBFusCATed:
What happens if you place `wx-config --libs ` in the compiler options? And `wx-config --cxxflags` in the linker?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version