Codelite 4.1 - linking with wxStyledTextCtrl

CodeLite installation/troubleshooting forum
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by eranif »

Can you add a prebuild command to your project that prints:

Code: Select all

which wx-config
Eran
Make sure you have read the HOW TO POST thread
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by ColinTaylor »

Eran, I've added the pre-build command that you suggested.
Here's the build output ...

Code: Select all

----------Building project:[ WxRequirementsChecker - Debug ]----------
mingw32-make.exe[1]: Entering directory `D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker'
Executing Pre Build commands ...
which wx-config
C:/CodeLite/wx-config.EXE
Done
mingw32-make.exe[1]: Leaving directory `D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker'
mingw32-make.exe[1]: Entering directory `D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker'
g++ -o ./Debug/WxRequirementsChecker @"D:\CodeLiteWorkspaces\ActiveProjects\WxRequirementsChecker\WxRequirementsChecker.txt" -L. -L../WxReusablesLib/Debug  -lWxReusablesLib  -mwindows  -mthreads -LC:\wxWidgets-2.9.4\lib\gcc_dll -lwxmsw29ud_xrc -lwxmsw29ud_aui -lwxmsw29ud_html -lwxmsw29ud_adv -lwxmsw29ud_core -lwxbase29ud_xml -lwxbase29ud_net -lwxmsw29ud_richtext -lwxbase29ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexud -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 
./Debug/main.o: In function `ZN9MainFrame14SetResultsFontER6wxFont':
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:330: undefined reference to `_imp___ZN16wxStyledTextCtrl12StyleSetFontEiR6wxFont'
./Debug/main.o: In function `ZN9MainFrame16SetResultsColourERK8wxColour':
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:336: undefined reference to `_imp___ZN16wxStyledTextCtrl18StyleSetBackgroundEiRK8wxColour'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:339: undefined reference to `_imp___ZN16wxStyledTextCtrl18StyleSetBackgroundEiRK8wxColour'
./Debug/main.o: In function `ZN9MainFrame24CreateAdditionalGUIItemsEv':
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:351: undefined reference to `_imp__wxSTCNameStr'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:351: undefined reference to `_imp___ZN16wxStyledTextCtrlC1EP8wxWindowiRK7wxPointRK6wxSizelRK8wxString'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:354: undefined reference to `_imp___ZN16wxStyledTextCtrl13StyleClearAllEv'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:355: undefined reference to `_imp___ZN16wxStyledTextCtrl8SetLexerEi'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:356: undefined reference to `_imp___ZN16wxStyledTextCtrl11SetKeyWordsEiRK8wxString'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:357: undefined reference to `_imp___ZN16wxStyledTextCtrl11SetKeyWordsEiRK8wxString'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:358: undefined reference to `_imp___ZN16wxStyledTextCtrl16SetSelBackgroundEbRK8wxColour'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:359: undefined reference to `_imp___ZN16wxStyledTextCtrl16SetSelForegroundEbRK8wxColour'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:361: undefined reference to `_imp___ZN16wxStyledTextCtrl10SetEOLModeEi'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:362: undefined reference to `_imp___ZN16wxStyledTextCtrl11SetWrapModeEi'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:363: undefined reference to `_imp___ZN16wxStyledTextCtrl14SetMarginWidthEii'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:364: undefined reference to `_imp___ZN16wxStyledTextCtrl14SetMarginWidthEii'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:365: undefined reference to `_imp___ZN16wxStyledTextCtrl25SetUseHorizontalScrollBarEb'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:366: undefined reference to `_imp___ZN16wxStyledTextCtrl23SetUseVerticalScrollBarEb'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:367: undefined reference to `_imp___ZN16wxStyledTextCtrl13SetMarginLeftEi'
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp:370: undefined reference to `_imp___ZN16wxStyledTextCtrl14SetExtraAscentEi'
./Debug/RequirementsExtractor.o: In function `ZN22CRequirementsExtractor7DisplayEP16wxStyledTextCtrl':
D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/RequirementsExtractor.cpp:107: undefined reference to `_imp___ZN16wxStyledTextCtrl8ClearAllEv'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [Debug/WxRequirementsChecker] Error 1
WxRequirementsChecker.mk:76: recipe for target `Debug/WxRequirementsChecker' failed
mingw32-make.exe[1]: Leaving directory `D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker'
mingw32-make.exe: *** [All] Error 2
ActiveProjects_wsp.mk:4: recipe for target `All' failed
----------Build Ended----------
20 errors, 0 warnings
Colin
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by eranif »

Can you attach the makefiles (both WxRequirementsChecker.mk & the workspace one)

Eran
Make sure you have read the HOW TO POST thread
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by ColinTaylor »

1. Not sure how to attach files, so here is the make file contents ...

Code: Select all

##
## Auto Generated makefile by CodeLite IDE
## any manual changes will be erased      
##
## Debug
ProjectName            :=WxRequirementsChecker
ConfigurationName      :=Debug
WorkspacePath          := "D:\CodeLiteWorkspaces\ActiveProjects"
ProjectPath            := "D:\CodeLiteWorkspaces\ActiveProjects\WxRequirementsChecker"
IntermediateDirectory  :=./Debug
OutDir                 := $(IntermediateDirectory)
CurrentFileName        :=
CurrentFilePath        :=
CurrentFileFullPath    :=
User                   :=colin
Date                   :=30/08/2012
CodeLitePath           :="C:\CodeLite"
LinkerName             :=g++
SharedObjectLinkerName :=g++ -shared -fPIC
ObjectSuffix           :=.o
DependSuffix           :=.o.d
PreprocessSuffix       :=.o.i
DebugSwitch            :=-gstab
IncludeSwitch          :=-I
LibrarySwitch          :=-l
OutputSwitch           :=-o 
LibraryPathSwitch      :=-L
PreprocessorSwitch     :=-D
SourceSwitch           :=-c 
OutputFile             :=$(IntermediateDirectory)/$(ProjectName)
Preprocessors          :=$(PreprocessorSwitch)__WX__ 
ObjectSwitch           :=-o 
ArchiveOutputSwitch    := 
PreprocessOnlySwitch   :=-E 
ObjectsFileList        :="D:\CodeLiteWorkspaces\ActiveProjects\WxRequirementsChecker\WxRequirementsChecker.txt"
PCHCompileFlags        :=
MakeDirCommand         :=makedir
RcCmpOptions           := $(shell wx-config --rcflags)
RcCompilerName         :=windres
LinkOptions            :=  -mwindows $(shell wx-config --debug=yes --libs std,stc --unicode=yes)
IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch)$(WorkspacePath)/WxReusablesLib 
IncludePCH             := 
RcIncludePath          := 
Libs                   := $(LibrarySwitch)WxReusablesLib 
ArLibs                 :=  "libWxReusablesLib.a" 
LibPath                := $(LibraryPathSwitch). $(LibraryPathSwitch)../WxReusablesLib/Debug 

##
## Common variables
## AR, CXX, CC, CXXFLAGS and CFLAGS can be overriden using an environment variables
##
AR       := ar rcus
CXX      := g++
CC       := gcc
CXXFLAGS :=  -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors)
CFLAGS   :=  -g -O0 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=yes) $(Preprocessors)


##
## User defined environment variables
##
CodeLiteDir:=C:\CodeLite
WXWIN:=C:\wxWidgets-2.9.4
PATH:=$(WXWIN)\lib\gcc_dll;$(PATH)
WXCFG:=gcc_dll\mswu
UNIT_TEST_PP_SRC_DIR:=C:\UnitTest++-1.3
Objects=$(IntermediateDirectory)/gui$(ObjectSuffix) $(IntermediateDirectory)/main$(ObjectSuffix) $(IntermediateDirectory)/RequirementsExtractor$(ObjectSuffix) $(IntermediateDirectory)/resources.rc$(ObjectSuffix) 

##
## Main Build Targets 
##
.PHONY: all clean PreBuild PrePreBuild PostBuild
all: $(OutputFile)

$(OutputFile): $(IntermediateDirectory)/.d ..\.build-debug\WxReusablesLib $(Objects) 
	@$(MakeDirCommand) $(@D)
	@echo "" > $(IntermediateDirectory)/.d
	@echo $(Objects) > $(ObjectsFileList)
	$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)

..\.build-debug\WxReusablesLib:
	@echo stam > "..\.build-debug\WxReusablesLib"




$(IntermediateDirectory)/.d:
	@$(MakeDirCommand) "./Debug"

PreBuild:
	@echo Executing Pre Build commands ...
	which wx-config
	@echo Done


##
## Objects
##
$(IntermediateDirectory)/gui$(ObjectSuffix): gui.cpp $(IntermediateDirectory)/gui$(DependSuffix)
	$(CXX) $(IncludePCH) $(SourceSwitch) "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/gui.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/gui$(ObjectSuffix) $(IncludePath)
$(IntermediateDirectory)/gui$(DependSuffix): gui.cpp
	@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/gui$(ObjectSuffix) -MF$(IntermediateDirectory)/gui$(DependSuffix) -MM "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/gui.cpp"

$(IntermediateDirectory)/gui$(PreprocessSuffix): gui.cpp
	@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/gui$(PreprocessSuffix) "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/gui.cpp"

$(IntermediateDirectory)/main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main$(DependSuffix)
	$(CXX) $(IncludePCH) $(SourceSwitch) "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath)
$(IntermediateDirectory)/main$(DependSuffix): main.cpp
	@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp"

$(IntermediateDirectory)/main$(PreprocessSuffix): main.cpp
	@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/main.cpp"

$(IntermediateDirectory)/RequirementsExtractor$(ObjectSuffix): RequirementsExtractor.cpp $(IntermediateDirectory)/RequirementsExtractor$(DependSuffix)
	$(CXX) $(IncludePCH) $(SourceSwitch) "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/RequirementsExtractor.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/RequirementsExtractor$(ObjectSuffix) $(IncludePath)
$(IntermediateDirectory)/RequirementsExtractor$(DependSuffix): RequirementsExtractor.cpp
	@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/RequirementsExtractor$(ObjectSuffix) -MF$(IntermediateDirectory)/RequirementsExtractor$(DependSuffix) -MM "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/RequirementsExtractor.cpp"

$(IntermediateDirectory)/RequirementsExtractor$(PreprocessSuffix): RequirementsExtractor.cpp
	@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/RequirementsExtractor$(PreprocessSuffix) "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/RequirementsExtractor.cpp"

$(IntermediateDirectory)/resources.rc$(ObjectSuffix): resources.rc
	$(RcCompilerName) -i "D:/CodeLiteWorkspaces/ActiveProjects/WxRequirementsChecker/resources.rc" $(RcCmpOptions)   $(ObjectSwitch)$(IntermediateDirectory)/resources.rc$(ObjectSuffix) $(RcIncludePath)

-include $(IntermediateDirectory)/*$(DependSuffix)
##
## Clean
##
clean:
	$(RM) $(IntermediateDirectory)/gui$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/gui$(DependSuffix)
	$(RM) $(IntermediateDirectory)/gui$(PreprocessSuffix)
	$(RM) $(IntermediateDirectory)/main$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/main$(DependSuffix)
	$(RM) $(IntermediateDirectory)/main$(PreprocessSuffix)
	$(RM) $(IntermediateDirectory)/RequirementsExtractor$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/RequirementsExtractor$(DependSuffix)
	$(RM) $(IntermediateDirectory)/RequirementsExtractor$(PreprocessSuffix)
	$(RM) $(IntermediateDirectory)/resources.rc$(ObjectSuffix)
	$(RM) $(OutputFile)
	$(RM) $(OutputFile).exe
	$(RM) "D:\CodeLiteWorkspaces\ActiveProjects\.build-debug\WxRequirementsChecker"
2. Can you explain what the "the workspace makefile" is, and where I can find it?

Colin
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by ColinTaylor »

Is this the workspace make file?

Code: Select all

.PHONY: clean All

All:
	@echo ----------Building project:[ WxReusablesLib - Debug ]----------
	@cd "WxReusablesLib" && "$(MAKE)" -f "WxReusablesLib.mk"
	@echo ----------Building project:[ WxRequirementsChecker - Debug ]----------
	@cd "WxRequirementsChecker" && "$(MAKE)" -f "WxRequirementsChecker.mk" PreBuild && "$(MAKE)" -f "WxRequirementsChecker.mk"
clean:
	@echo ----------Cleaning project:[ WxReusablesLib - Debug ]----------
	@cd "WxReusablesLib" && "$(MAKE)" -f "WxReusablesLib.mk"  clean
	@echo ----------Cleaning project:[ WxRequirementsChecker - Debug ]----------
	@cd "WxRequirementsChecker" && "$(MAKE)" -f "WxRequirementsChecker.mk" clean
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by eranif »

Yes, the later is the workspace makefile.

Ok, I have no choice, I am on logging onto my Windows box ! hold on ;)

Eran
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by eranif »

OK, problem solved:

Remove the --unicode=yes

Use this command and it will fix your problems:

Code: Select all

$(shell wx-config --debug=yes --libs stc,std)
It seems that --libs needs to be the last on the list

Eran
Make sure you have read the HOW TO POST thread
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by ColinTaylor »

Eran, many thanks for the fix, which does indeed work.

When I create a new project, the default linker options appear as follows ...

Code: Select all

-mwindows;$(shell wx-config --debug=yes --libs --unicode=yes)
Is there any way for me to automatically change the ordering for all new projects?

Code: Select all

-mwindows;$(shell wx-config --debug=yes  --unicode=yes --libs)
Thanks again, Colin
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by eranif »

You can fix the template files
I am not sure which template file you fixed, but the template files exists under:

CODELITE_INSTALL_DIR\templates\projects\

Open the templates (the wx ones) and open the .project file and replace it there

Another solution (a preferred one) is to fix wx-config
Eran
Make sure you have read the HOW TO POST thread
ColinTaylor
CodeLite Expert
Posts: 152
Joined: Fri Jul 15, 2011 2:49 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Codelite 4.1 - linking with wxStyledTextCtrl

Post by ColinTaylor »

Thanks again for your help today :-)
Post Reply