I installed wxWidgets 3.0.3 using the command sequence for my Ubuntu 16.04 OS (xenial) using these instructions:
http://codelite.org/LiteEditor/WxWidgets303Binaries
I am using wxWidgets 3.0.3 because that was the latest and greatest when the project was started on a Windows 7 Machine. On that Windows 7 machine I tried to upgrade to wxWidgets 3.0.4 and got a lot of errors I did not have time to deal with. Now attempting to migrate it to my Ubuntu machine using Code::Blocks 17.12 with wxWidgets 3.0.3
Now in Ubuntu Code::Blocks does not know where wxWidgets is. All wxWigets classes got undefined errors. So I followed the instructions at:
https://wiki.wxwidgets.org/Wx-Config
As I understand them. To do this I went to Project => Build Options => Compiler Flags . In this tab I right clicked and selected "New Flag". I selected the General Category. In the Name field I entered: "wxWidgets". In the Compiler flags field I entered `wx-config --cxxflags`. And in the Linker flags field I entered: `wx-config --libs`
When attempted to compile I got the error:
wx-config No such file or directory
So I executed this command on and got this respoonse:
which wx-config
/usr/local/bin/wx-config
And then put the path in the flags such that I have now for those two flags:
Compiler flags: `/usr/local/bin/wx-config --cxxflags`
Linker Flags: `/usr/local/bin/wx-config --libs`
And got the same error. Then I tried exchanging ` for ' so that now I have:
Compiler flags: '/usr/local/bin/wx-config --cxxflags'
Linker Flags: '/usr/local/bin/wx-config --libs'
And I got the compile error:
error ld returned 1 exit status
I do not know where to go with this from here. Do I have the wx-config flags entered correctly? If they are what is to be done about the "ld returned 1" error?
In the included cbp file I changed the apostrophe back to the back tick.
not everywhere:
<Target title="Debug">
<Option output="bin/Debug/TIA Designer" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="0" />
<Option compiler="gcc" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
<Add option="'wx-config --cxxflags'" />
<Add option="-g" />
</Compiler>
<Linker>
<Add option="`wx-config --libs`" />
</Linker>
</Target>
The build log:
-------------- Clean: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------
Cleaned "TIA Designer - Debug"
-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------
g++ -Wall -I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread 'wx-config --cxxflags' -g -g -I../Libraries/cminpack-1.3.6 -Iinclude -c "/home/me/Engineering Software/Libraries/cminpack-1.3.6/cpp/dpmpar.cpp" -o obj/Debug/Libraries/cminpack-1.3.6/cpp/dpmpar.o
g++: error: wx-config: No such file or directory
g++: fatal error: no input files
compilation terminated.
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
i do not understand your last answer... But in general:
Backticks
are executed by codeblocks and the stdout output of this program replaces the text within the backticks....
For example
will be replaced by
-I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
on my machine....
"Normal" ticks
'this is passed trough the command line'
will expand to
'this is passed trough the command line'
In your last build log are still the normal ticks for the compiler flags...
If you have changed them and still get errors post the new build log...
When these flags are in effect:
`/usr/local/bin/wx-config --cxxflags`
`/usr/local/bin/wx-config --libs`
The build log is:
-------------- Clean: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------
Cleaned "TIA Designer - Debug"
-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------
g++ -Wall -I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread -I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread -g '/usr/local/bin/wx-config --cxxflags' 'wx-config --cxxflags' -I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread -g -I../Libraries/cminpack-1.3.6 -Iinclude -c "/home/me/Engineering Software/Libraries/cminpack-1.3.6/cpp/dpmpar.cpp" -o obj/Debug/Libraries/cminpack-1.3.6/cpp/dpmpar.o
/usr/local/bin/wx-config: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
So now I get the same error whether ' or `is used. This time I was closing and reopening Code::Blocks after this was changed and before the compile attempt.
When these flags are in effect:
'/usr/local/bin/wx-config --cxxflags'
'/usr/local/bin/wx-config --libs'
The build log is:
-------------- Clean: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------
Cleaned "TIA Designer - Debug"
-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------
g++ -Wall -I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread '/usr/local/bin/wx-config --cxxflags' -g 'wx-config --cxxflags' '/usr/local/bin/wx-config --cxxflags' -g -I/usr/local/lib/wx/include/gtk2-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread -I../Libraries/cminpack-1.3.6 -Iinclude -c "/home/me/Engineering Software/Libraries/cminpack-1.3.6/cpp/dpmpar.cpp" -o obj/Debug/Libraries/cminpack-1.3.6/cpp/dpmpar.o
/usr/local/bin/wx-config: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
So now I get the same error. This time I was closing and reopening Code::Blocks after the change and before the compile attempt.
For the wx global variable in Settings => Global I have as base:
/home/me/Packages/wxWidgets-3.0.3
This path does not exist on my drive. The path:
/usr/include/wx-3.0-unofficial
does. Is this what I should set wx to?
I believe this path was put there by the commands I used to do the install instrucitons at: http://codelite.org/LiteEditor/WxWidgets303Binaries
This is a simple text search in the file you've sent:
$ grep wx-config TIA\ Designer.cbp
<Add option="'/usr/local/bin/wx-config --cxxflags'" />
<Add option="'/usr/local/bin/wx-config --libs'" />
<Add option="'/usr/local/bin/wx-config --cxxflags'" />
<Add option="'/usr/local/bin/wx-config --libs'" />
<Add option="`/usr/local/bin/wx-config --cxxflags`" />
<Add option="`/usr/local/bin/wx-config --libs`" />
So you have 4 time the incorrect version of the wx-config.
Go inspect the configurations for all targets and the project options. On the left side of the dialog Project -> Build options you should see a tree control. This control is used to select the build targets or project options. Please inspect and fix them all.