fresh install, can't compile simple projects out of the box

CodeLite installation/troubleshooting forum
polo78
CodeLite Curious
Posts: 4
Joined: Wed Feb 10, 2010 6:56 pm
Genuine User: Yes
IDE Question: C++
Contact:

fresh install, can't compile simple projects out of the box

Post by polo78 »

This is related to issue #2949093.
CodeLite: 2.2.0.3681
OS: Ubuntu 9.10 x86

I get compiler errors while tyring to build simple projects, such as those created by CL's project wizard. Please note that I've already applied the fix described in #2944098.
As an example, I start CodeLite and create a new workspace. Then I create a new project, and select "GUI -> Executable (wxWidgets + wxFB frame)" as project template. All other options are set to their default values. If I try to build the project, I get this failure:

----------Build Started--------
/bin/sh -c '"make" -j 1 -f "Prova1_wsp.mk"'
----------Building project:[ GuiApp - Debug ]----------
make[1]: ingresso nella directory «/home/marco/Sviluppo/Codelite/Prova1»
g++ -c -o ./Debug/GuiApp -g -I/usr/lib/wx/include/gtk2-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXGTK__ -pthread -D__WX__ gui.cpp main.cpp
g++: cannot specify -o with -c or -S with multiple files
make[1]: *** [Debug/GuiApp] Errore 1
make[1]: uscita dalla directory «/home/marco/Sviluppo/Codelite/Prova1»
make: *** [All] Errore 2
----------Build Ended----------
0 errors, 0 warnings

(some messages are in Italian but I think they're not relevant in this context).

So the problem is related to g++ trying to compile multiple source files at once (gui.cpp and main.cpp) while also specifying the -c and -o switches.
Also, I find it weird that the last message says "0 errors". Shouldn't this error be reported?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: fresh install, can't compile simple projects out of the box

Post by eranif »

Can you try and create another WX project, but this time using the wizard?

From: Plugins -> Gizmos -> New wxWidgets project'

Does it also fails from there? (it uses different method)

Eran
Make sure you have read the HOW TO POST thread
polo78
CodeLite Curious
Posts: 4
Joined: Wed Feb 10, 2010 6:56 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: fresh install, can't compile simple projects out of the box

Post by polo78 »

eranif wrote:Can you try and create another WX project, but this time using the wizard?

From: Plugins -> Gizmos -> New wxWidgets project'

Does it also fails from there? (it uses different method)

Eran
It still fails, same error:

----------Build Started--------
/bin/sh -c '"make" -j 1 -f "Prova1_wsp.mk"'
----------Building project:[ Gizmo1 - Debug ]----------
make[1]: ingresso nella directory «/home/marco/Sviluppo/Codelite/Prova1/Gizmo1»
g++ -c -o ./Debug/Gizmo1 -g -I/usr/lib/wx/include/gtk2-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXGTK__ -pthread -D__WX__ gizmo1_app.cpp gizmo1_frame.cpp
g++: cannot specify -o with -c or -S with multiple files
make[1]: *** [Debug/Gizmo1] Errore 1
make[1]: uscita dalla directory «/home/marco/Sviluppo/Codelite/Prova1/Gizmo1»
make: *** [All] Errore 2
----------Build Ended----------
0 errors, 0 warnings

Note that I've used the "GUI application with main frame" preset, which creates two source files. If I select "Simple main with wxWidgets enabled" instead, it creates a single .cpp file, and the project builds cleanly.

Marco
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: fresh install, can't compile simple projects out of the box

Post by eranif »

Can u paste here the content of the generated makefiles:
Prova1_wsp.mk
and
Gizmos1.mk

Thanks
Eran
Make sure you have read the HOW TO POST thread
polo78
CodeLite Curious
Posts: 4
Joined: Wed Feb 10, 2010 6:56 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: fresh install, can't compile simple projects out of the box

Post by polo78 »

Eran,
these are the makefiles:

Prova1_wsp.mk

Code: Select all

.PHONY: clean All

All:
	@echo ----------Building project:[ Gizmo1 - Debug ]----------
	@cd "Gizmo1" && "$(MAKE)" -f "Gizmo1.mk"
clean:
	@echo ----------Cleaning project:[ Gizmo1 - Debug ]----------
	@cd "Gizmo1" && "$(MAKE)" -f "Gizmo1.mk" clean
Gizmo1.mk

Code: Select all

##
## Auto Generated makefile, please do not edit
##
ProjectName:=Gizmo1

## Debug
ConfigurationName      :=Debug
IntermediateDirectory  :=./Debug
OutDir                 := $(IntermediateDirectory)
WorkspacePath          := "/home/marco/Sviluppo/Codelite/Prova1"
ProjectPath            := "/home/marco/Sviluppo/Codelite/Prova1/Gizmo1"
CurrentFileName        :=
CurrentFilePath        :=
CurrentFileFullPath    :=
User                   :=Marco Jez
Date                   :=10/02/2010
CodeLitePath           :="/home/marco/.codelite"
LinkerName             :=g++
ArchiveTool            :=ar rcus
SharedObjectLinkerName :=g++ -shared -fPIC
ObjectSuffix           :=.o
DependSuffix           :=.o.d
PreprocessSuffix       :=
DebugSwitch            :=-gstab
IncludeSwitch          :=-I
LibrarySwitch          :=-l
OutputSwitch           :=-o 
LibraryPathSwitch      :=-L
PreprocessorSwitch     :=-D
SourceSwitch           :=-c 
CompilerName           :=g++
C_CompilerName         :=gcc
OutputFile             :=$(IntermediateDirectory)/Gizmo1
Preprocessors          :=$(PreprocessorSwitch)__WX__ 
ObjectSwitch           :=-o 
ArchiveOutputSwitch    := 
PreprocessOnlySwitch   :=
CmpOptions             := -g  $(shell wx-config --cxxflags --unicode=yes --static=no --universal=no --debug=yes ) $(Preprocessors)
LinkOptions            :=  -O2 $(shell wx-config --debug=yes --libs --unicode=yes --static=no --universal=no ) 
IncludePath            :=  "$(IncludeSwitch)." 
RcIncludePath          :=
Libs                   :=
LibPath                := "$(LibraryPathSwitch)." 


Srcs=gizmo1_app.cpp gizmo1_frame.cpp 

Objects=$(IntermediateDirectory)/gizmo1_app$(ObjectSuffix) $(IntermediateDirectory)/gizmo1_frame$(ObjectSuffix) 

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

$(OutputFile): makeDirStep $(Srcs)
	@mkdir -p $(@D)
	$(CompilerName) $(SourceSwitch) $(OutputSwitch)$(OutputFile) $(Libs) $(CmpOptions) $(Srcs)

makeDirStep:
	@test -d ./Debug || mkdir -p ./Debug

PreBuild:
##
## Clean
##
clean:
	$(RM) $(IntermediateDirectory)/gizmo1_app$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/gizmo1_app$(DependSuffix)
	$(RM) $(IntermediateDirectory)/gizmo1_app$(PreprocessSuffix)
	$(RM) $(IntermediateDirectory)/gizmo1_frame$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/gizmo1_frame$(DependSuffix)
	$(RM) $(IntermediateDirectory)/gizmo1_frame$(PreprocessSuffix)
	$(RM) $(OutputFile)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: fresh install, can't compile simple projects out of the box

Post by eranif »

By Looking the generated makefile, I can see the problem: You are using wrong builder.

Change the builder from 'GNU makefile onestep build' -> 'GNU makefile for g++/gcc'

This is done from:
settings -> build settings -> Build systems

It should work now.
Eran
Make sure you have read the HOW TO POST thread
polo78
CodeLite Curious
Posts: 4
Joined: Wed Feb 10, 2010 6:56 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: fresh install, can't compile simple projects out of the box

Post by polo78 »

That made it, Eran. Now it makes sense, as I had to mess with that setting in order to fix the mingw32-make.exe bug. I probably assumed that the "Available Build Systems" combo box was there only to provide context to the controls below, rather than actually selecting the currently active build system.
Thanks for your help, and sorry for the noise!

Marco
Post Reply