Page 4 of 5

Re: FLTK with CodeLite

Posted: Wed Aug 24, 2011 7:50 pm
by Hacker John
Eran, building the "hello world" example (simple C/C++, no GUI stuff involved) I can get a build but in a roundabout way. "Build project" does not work and I get.

Code: Select all

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "CLtest_wsp.mk""
mingw32-make.exe: *** [All] Error 1
----------Build Ended----------
0 errors, 0 warnings
If I choose "Build Workspace", the Debug folder containing a "main.o.d" file is created and I get the following output

Code: Select all

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "CLtest.mk"  all"
----------Building project:[ CLtest - Debug ]----------
mingw32-make.exe: *** [Debug/main.o.d] Error 1
----------Build Ended----------
0 errors, 0 warnings
If i then compile the main.cpp file and re-run "Build Workspace", the main.o and the exe file then appear in the Debug folder (ie success)

On compiling main.cpp

Code: Select all

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "CLtest.mk"  ./Debug/main.o"
----------Building project:[ CLtest - Debug ] (Single File Build)----------
g++ -c  "C:/Users/john/DEV/C/CLtest/main.cpp" -g  -o ./Debug/main.o -I. -I. 
----------Build Ended----------
0 errors, 0 warnings
and on building the workspace again

Code: Select all

----------Build Started--------
C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "CLtest.mk"  all"
----------Building project:[ CLtest - Debug ]----------
g++ -o ./Debug/CLtest ./Debug/main.o  -L.   
----------Build Ended----------
0 errors, 0 warnings
Sorry to keep going on about this but I'm rather stuck.

Regards, John

Re: FLTK with CodeLite

Posted: Wed Aug 24, 2011 8:31 pm
by eranif
First, lets remove everything you have modified so I will know that you start from an un-modified codelite (uninstalling codelite won't help, since there are user files which are not deleted when un-installing codelite)

1) Close codelite
2) Delete %appdata%\CodeLite
3) Open codelite, load your workspace and open main.cpp
4) Right click on main.cpp
5) Select 'Open Shell at file path'
6) cd to the CLtest_wsp.mk directory
7) type:

Code: Select all

C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 2 -f "CLtest_wsp.mk""
If codelite fails, then the CMD should fail

Eran

Re: FLTK with CodeLite

Posted: Wed Aug 24, 2011 10:33 pm
by Hacker John
Sorry eran, CMD works, Codelite still fails.

Re: FLTK with CodeLite

Posted: Wed Aug 24, 2011 11:05 pm
by eranif
can you try and reduce the number of build processes to 1 and see if it make any change?
settings | build settings | build system
"number of concurrent jobs" set it to 1

I honestly has no idea how can it work from cmd that you just opened from codelite and it fails from codelite itself (unless you have modified some PATH variables inside codelite somewhere)

Eran

Re: FLTK with CodeLite

Posted: Wed Aug 24, 2011 11:20 pm
by Hacker John
Changing the number of concurrent jobs doesn't work either. The environment variable paths are currently

Code: Select all

CodeLiteDir=C:\CodeLite
WXWIN=C:\wxWidgets-2.8.12
PATH=$(WXWIN)\lib\gcc_dll;$(PATH)
WXCFG=gcc_dll\mswu
UNIT_TEST_PP_SRC_DIR=C:\UnitTest++-1.3
Weirdly, running Build Workspace, compile source file then Build Workspace again does the job. The differences between the "Build Project" and "Build Workspace" commands are:

Code: Select all

C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 1 -f "CLtest_wsp.mk""

C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 1 -f "CLtest.mk"  all"

Re: FLTK with CodeLite

Posted: Thu Aug 25, 2011 12:18 am
by eranif
can you post the makefiles?

Re: FLTK with CodeLite

Posted: Thu Aug 25, 2011 12:36 am
by Hacker John
CLtest_wsp.mk has these lines

Code: Select all

.PHONY: clean All

All:
	@echo ----------Building project:[ CLtest - Debug ]----------
	@"mingw32-make.exe"  -j 1 -f "CLtest.mk"
clean:
	@echo ----------Cleaning project:[ CLtest - Debug ]----------
	@"mingw32-make.exe"  -j 1 -f "CLtest.mk" clean
So the message

Code: Select all

C:\Windows\system32\cmd.exe /c ""mingw32-make.exe"  -j 1 -f "CLtest_wsp.mk""
mingw32-make.exe: *** [All] Error 1
suggests to me that it fails at "All:" and does not even reach the line

Code: Select all

"mingw32-make.exe"  -j 1 -f "CLtest.mk"
so the makefile Cltest.mk does not even get run. I'm not trying to tell you how your own software works, by the way, just thinking out loud.

Re: FLTK with CodeLite

Posted: Thu Aug 25, 2011 12:38 am
by Hacker John
Sorry eran, I cross-posted. Here are the makefiles:

Cltest_wsp.mk:

Code: Select all

.PHONY: clean All

All:
	@echo ----------Building project:[ CLtest - Debug ]----------
	@"mingw32-make.exe"  -j 1 -f "CLtest.mk"
clean:
	@echo ----------Cleaning project:[ CLtest - Debug ]----------
	@"mingw32-make.exe"  -j 1 -f "CLtest.mk" clean
CLtest.mk:

Code: Select all

##
## Auto Generated makefile by CodeLite IDE
## any manual changes will be erased      
##
## Debug
ProjectName            :=CLtest
ConfigurationName      :=Debug
IntermediateDirectory  :=./Debug
OutDir                 := $(IntermediateDirectory)
WorkspacePath          := "C:\Users\john\DEV\C\CLtest"
ProjectPath            := "C:\Users\john\DEV\C\CLtest"
CurrentFileName        :=
CurrentFilePath        :=
CurrentFileFullPath    :=
User                   :=john
Date                   :=08/24/11
CodeLitePath           :="C:\CodeLite"
LinkerName             :=g++
ArchiveTool            :=ar rcus
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 
CompilerName           :=g++
C_CompilerName         :=gcc
OutputFile             :=$(IntermediateDirectory)/$(ProjectName)
Preprocessors          :=
ObjectSwitch           :=-o 
ArchiveOutputSwitch    := 
PreprocessOnlySwitch   :=-E 
ObjectsFileList        :="C:\Users\john\DEV\C\CLtest\CLtest.txt"
MakeDirCommand         :=makedir
CmpOptions             := -g $(Preprocessors)
C_CmpOptions           := -g $(Preprocessors)
LinkOptions            :=  
IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). 
RcIncludePath          :=
Libs                   :=
LibPath                := $(LibraryPathSwitch). 


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

##
## Main Build Targets 
##
all: $(OutputFile)

$(OutputFile): makeDirStep $(Objects)
	@$(MakeDirCommand) $(@D)
	$(LinkerName) $(OutputSwitch)$(OutputFile) $(Objects) $(LibPath) $(Libs) $(LinkOptions)

objects_file:
	@echo $(Objects) > $(ObjectsFileList)

makeDirStep:
	@$(MakeDirCommand) "./Debug"

PreBuild:


##
## Objects
##
$(IntermediateDirectory)/main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main$(DependSuffix)
	$(CompilerName) $(SourceSwitch) "C:/Users/john/DEV/C/CLtest/main.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/main$(ObjectSuffix) $(IncludePath)
$(IntermediateDirectory)/main$(DependSuffix): main.cpp
	@$(CompilerName) $(CmpOptions) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main$(ObjectSuffix) -MF$(IntermediateDirectory)/main$(DependSuffix) -MM "C:/Users/john/DEV/C/CLtest/main.cpp"

$(IntermediateDirectory)/main$(PreprocessSuffix): main.cpp
	@$(CompilerName) $(CmpOptions) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main$(PreprocessSuffix) "C:/Users/john/DEV/C/CLtest/main.cpp"


-include $(IntermediateDirectory)/*$(DependSuffix)
##
## Clean
##
clean:
	$(RM) $(IntermediateDirectory)/main$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/main$(DependSuffix)
	$(RM) $(IntermediateDirectory)/main$(PreprocessSuffix)
	$(RM) $(OutputFile)
	$(RM) $(OutputFile).exe



Re: FLTK with CodeLite

Posted: Thu Aug 25, 2011 9:00 am
by eranif
When you at the command line (that opened from within codelite)

Please type:

Code: Select all

which mingw32-make
followed by:

Code: Select all

which g++
also, please type:

Code: Select all

echo %SHELL%
Eran

Re: FLTK with CodeLite

Posted: Thu Aug 25, 2011 11:13 am
by Hacker John
Hi eran

"which mingw32-make" gives:

Code: Select all

which: no mingw-make in (.;C:/wxWidgets-2.8.12/lib/gcc_dll;C:/Program Files/Common Files/Microsoft Shared/Windows Live;C:/Windows/system32
;C:/Windows;C:/Windows/System32/Wbem;C:/Windows/System32/WindowsPowerShell/v1.0/;C:/Program Files/WIDCOMM/Bluetooth Software/
;C:/Program Files/Common Files/Roxio Shared/DLLShared/;C:/Program Files/Common Files/Roxio Shared/10.0/DLLShared/
;c:/Python31;C:/ProgramFiles/AbiWord/bin;C:/Program Files/PDFCreator;C:/Program Files/Windows Live/Shared
;C:/Windows/Microsoft.NET/Framework/v3.5/;C:/fltk-1.3.0;C:/fltk-1.3.0/fluid;c:/msys/1.0;C:/CodeLite;;C:/MinGW-4.4.1/bin)
Though "which mingw32-make" gives:

Code: Select all

C:/MinGW-4.4.1/bin/mingw32-make.EXE
"which g++":

Code: Select all

C:/MinGW-4.4.1/bin/g++.EXE
"echo %SHELL%" returns only " %SHELL%"

John