Enabling Eclipse to compile and execute a wxWidgets applications is a non trivial task. These recommendations offer remedy to the situation.
The g++ command line should be modified as follows.
[codesyntax lang=”text”]
g++ `/usr/local/bin/wx-config --cflags` -std=c++11
[/codesyntax]
Of course if you wx-config script is in a different location you should make you entry reflect that location.
The linkage command line should be modified to reflect the following at the Miscellaneous input location.
[codesyntax lang=”text”]
`/usr/local/bin/wx-config --libs` -lboost_system -lboost_filesystem -lboost_date_time
[/codesyntax]
At a minimum my application support boost functions as listed.
The order of the command line flags must be modified to show the following order.
[codesyntax lang=”text”]
${COMMAND} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${FLAGS}
[/codesyntax]
I have noticed that the Properties page for the project does not correctly reflect what is in the configuration “.cproject” configuration file. I would expect it to update correctly but is does not as of the writing of this article.
I will include the “.cproject” file in its entirety to assist in providing clarity on the requirements.
[codesyntax lang=”text”]
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage"> <storageModule moduleId="org.eclipse.cdt.core.settings"> <cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1376135902"> <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1376135902" moduleId="org.eclipse.cdt.core.settings" name="Debug"> <externalSettings/> <extensions> <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> </extensions> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1376135902" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug"> <folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1376135902." name="/" resourcePath=""> <toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.198842636" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug"> <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.1744987789" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/> <builder buildPath="${workspace_loc:/hw01}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.1308974146" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/> <tool id="cdt.managedbuild.tool.gnu.archiver.base.1338674325" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> <tool command="g++ `/usr/local/bin/wx-config --cflags` -std=c++11" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1787558098" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug"> <option id="gnu.cpp.compiler.exe.debug.option.optimization.level.534230145" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/> <option id="gnu.cpp.compiler.exe.debug.option.debugging.level.1430491497" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/> <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.944214739" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1931276423" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug"> <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.2051545632" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/> <option id="gnu.c.compiler.exe.debug.option.debugging.level.974580761" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.323736955" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1690417379" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/> <tool command="g++ " commandLinePattern="${COMMAND} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${FLAGS} " id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.426239939" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug"> <option id="gnu.cpp.link.option.flags.1908252906" name="Linker flags" superClass="gnu.cpp.link.option.flags" useByScannerDiscovery="false" value="`/usr/local/bin/wx-config --libs` -lboost_system -lboost_filesystem -lboost_date_time" valueType="string"/> <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1229372852" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> <additionalInput kind="additionalinput" paths="$(LIBS)"/> </inputType> </tool> <tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.2020869963" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug"> <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1433667641" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> </tool> </toolChain> </folderInfo> <sourceEntries> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> </sourceEntries> </configuration> </storageModule> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> </cconfiguration> <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.2084365580"> <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.2084365580" moduleId="org.eclipse.cdt.core.settings" name="Release"> <externalSettings/> <extensions> <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/> <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/> <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/> </extensions> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.2084365580" name="Release" parent="cdt.managedbuild.config.gnu.exe.release"> <folderInfo id="cdt.managedbuild.config.gnu.exe.release.2084365580." name="/" resourcePath=""> <toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.184596974" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release"> <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1847335341" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/> <builder buildPath="${workspace_loc:/hw01}/Release" id="cdt.managedbuild.target.gnu.builder.exe.release.108802280" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/> <tool id="cdt.managedbuild.tool.gnu.archiver.base.1953000961" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/> <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.820042358" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release"> <option id="gnu.cpp.compiler.exe.release.option.optimization.level.98714100" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/> <option id="gnu.cpp.compiler.exe.release.option.debugging.level.1823904921" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/> <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1193160239" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.788238485" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release"> <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.660460526" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/> <option id="gnu.c.compiler.exe.release.option.debugging.level.668506269" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2065226631" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> </tool> <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.627853970" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/> <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1656309359" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release"> <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1886188289" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input"> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> <additionalInput kind="additionalinput" paths="$(LIBS)"/> </inputType> </tool> <tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.1668565012" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release"> <inputType id="cdt.managedbuild.tool.gnu.assembler.input.897952324" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> </tool> </toolChain> </folderInfo> <sourceEntries> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/> </sourceEntries> </configuration> </storageModule> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/> </cconfiguration> </storageModule> <storageModule moduleId="cdtBuildSystem" version="4.0.0"> <project id="hw01.cdt.managedbuild.target.gnu.exe.1679230592" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/> </storageModule> <storageModule moduleId="scannerConfiguration"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1376135902;cdt.managedbuild.config.gnu.exe.debug.1376135902.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1931276423;cdt.managedbuild.tool.gnu.c.compiler.input.323736955"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> </scannerConfigBuildInfo> <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.2084365580;cdt.managedbuild.config.gnu.exe.release.2084365580.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.788238485;cdt.managedbuild.tool.gnu.c.compiler.input.2065226631"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> </scannerConfigBuildInfo> <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1376135902;cdt.managedbuild.config.gnu.exe.debug.1376135902.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1787558098;cdt.managedbuild.tool.gnu.cpp.compiler.input.944214739"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> </scannerConfigBuildInfo> <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.2084365580;cdt.managedbuild.config.gnu.exe.release.2084365580.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.820042358;cdt.managedbuild.tool.gnu.cpp.compiler.input.1193160239"> <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/> </scannerConfigBuildInfo> </storageModule> <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/> <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/> <storageModule moduleId="refreshScope" versionNumber="2"> <configuration configurationName="Debug"> <resource resourceType="PROJECT" workspacePath="/hw01"/> </configuration> <configuration configurationName="Release"> <resource resourceType="PROJECT" workspacePath="/hw01"/> </configuration> </storageModule> </cproject>
[/codesyntax]
The version of c++ currently used is listed below.
[codesyntax lang=”bash”]
g++ --version g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[/codesyntax]
Below is a screenshot of the Oxygen c++ compiler.
Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.