Page 1 of 1

FreeBSD 9.0, "need operator" error

Posted: Mon Aug 27, 2012 2:55 am
by CanOfBees
Hi all,

Apologies if this has been addressed before. Several searches (and a couple of different fix attempts) haven't yielded a solution to this problem.

CodeLite version: 4.0.5589
OS: FreeBSD 9.0/PC-BSD 9.0 amd64, Lxde
I've updated my gdb from 6.1.1 to 7.3.1.

When I try to build and run a project ("Hello World"), I get the following error in the Build tab:

Code: Select all

----------Build Started--------
/bin/sh -c '"make"  -j 2 -f "genericWorkspace_wsp.mk"'
----------Building project:[ HelloWorld - Debug ]----------
"HelloWorld.mk", line 87: Need an operator
make: fatal errors encountered -- cannot continue
*** Error code 1
1 error
----------Build Ended----------
0 errors, 0 warnings
I've tried to enable Debugging, but I don't seem to be getting any debugging output. Any suggestions or guidance will be greatly appreciated.

Cheers!

Here is the HelloWorld.mk file:

Code: Select all

##
## Auto Generated makefile by CodeLite IDE
## any manual changes will be erased      
##
## Debug
ProjectName            :=HelloWorld
ConfigurationName      :=Debug
IntermediateDirectory  :=./Debug
OutDir                 := $(IntermediateDirectory)
WorkspacePath          := "/home/CanOfBees/Documents/genericWorkspace"
ProjectPath            := "/home/CanOfBees/Documents/genericWorkspace/HelloWorld"
CurrentFileName        :=
CurrentFilePath        :=
CurrentFileFullPath    :=
User                   :=CanOfBees
Date                   :=08/26/2012
CodeLitePath           :="/usr/home/CanOfBees/.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        :="/home/CanOfBees/Documents/genericWorkspace/HelloWorld/HelloWorld.txt"
PCHCompileFlags        :=
MakeDirCommand         :=mkdir -p
CmpOptions             := -g -O0 -Wall $(Preprocessors)
C_CmpOptions           := -g -O0 -Wall $(Preprocessors)
LinkOptions            :=  
IncludePath            :=  $(IncludeSwitch). $(IncludeSwitch). 
IncludePCH             := 
RcIncludePath          := 
Libs                   := 
LibPath                := $(LibraryPathSwitch). 


##
## User defined environment variables
##
CodeLiteDir:=/usr/pbi/codelite-amd64/share/codelite
Objects=$(IntermediateDirectory)/main$(ObjectSuffix) 

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

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

$(IntermediateDirectory)/.d:
	@test -d ./Debug || $(MakeDirCommand) ./Debug

PreBuild:


##
## Objects
##
$(IntermediateDirectory)/HelloWorld_main$(ObjectSuffix): main.cpp $(IntermediateDirectory)/HelloWorld_main$(DependSuffix)
	$(CompilerName) $(IncludePCH) $(SourceSwitch) "/usr/home/CanOfBees/Documents/genericWorkspace/HelloWorld/main.cpp" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/HelloWorld_main$(ObjectSuffix) $(IncludePath)
$(IntermediateDirectory)/HelloWorld_main$(DependSuffix): main.cpp
	@$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/HelloWorld_main$(ObjectSuffix) -MF$(IntermediateDirectory)/HelloWorld_main$(DependSuffix) -MM "/usr/home/CanOfBees/Documents/genericWorkspace/HelloWorld/main.cpp"

$(IntermediateDirectory)/HelloWorld_main$(PreprocessSuffix): main.cpp
	@$(CompilerName) $(CmpOptions) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/HelloWorld_main$(PreprocessSuffix) "/usr/home/CanOfBees/Documents/genericWorkspace/HelloWorld/main.cpp"


-include $(IntermediateDirectory)/*$(DependSuffix)
##
## Clean
##
clean:
	$(RM) $(IntermediateDirectory)/HelloWorld_main$(ObjectSuffix)
	$(RM) $(IntermediateDirectory)/HelloWorld_main$(DependSuffix)
	$(RM) $(IntermediateDirectory)/HelloWorld_main$(PreprocessSuffix)
	$(RM) $(OutputFile)
	$(RM) "/home/CanOfBees/Documents/genericWorkspace/.build-debug/HelloWorld"



Re: FreeBSD 9.0, "need operator" error

Posted: Mon Aug 27, 2012 12:20 pm
by DavidGH
Hi,
I've tried to enable Debugging, but I don't seem to be getting any debugging output.
Well, no. Debugging symbols are for when you run the built binary, not for the build process.

Warning: I know almost nothing about BSDs, so some of what follows may be entirely inaccurate/inappropriate. Still, that's never stopped me before ;) .

One obvious thing to check is whether you have a full set of 'build' tools: 'make', 'gcc' etc. Try building HelloWorld in a terminal outside CodeLite and see if it works; if not, the error message is likely to be more helpful.

To Linux eyes, '/usr/home/CanOfBees/Documents/genericWorkspace/HelloWorld/main.cpp' seems a strange filepath. Does it exist? Is it intentional? Do you have the necessary permissions to process files there (in Linux, /usr/ is root-owned)?

The error mentions line 87, which in the posted code is: -include $(IntermediateDirectory)/*$(DependSuffix). That line is correct for a CodeLite mk file. Is it your line 87? If not, which is?

I hope some that that helps.

Regards,

David

Re: FreeBSD 9.0, "need operator" error

Posted: Mon Aug 27, 2012 12:37 pm
by Jarod42
Which 'make' do you use ?
It seems there are incompatibilities between BSD make and GNU make.

You can change the make used :
In Settings -> Build Settings...
Build Systems,'Build Tool:'.

Re: FreeBSD 9.0, "need operator" error

Posted: Mon Aug 27, 2012 4:22 pm
by CanOfBees
Hi David & Jarod42 -- thanks for the replies!

DavidGH wrote:...snip...
One obvious thing to check is whether you have a full set of 'build' tools: 'make', 'gcc' etc. Try building HelloWorld in a terminal outside CodeLite and see if it works; if not, the error message is likely to be more helpful.
(I'm pretty sure that) I have all of the necessary build tools -- make, gmake, gcc, g++, cc, etc. I think part of the issue may be that the Build settings weren't pointed towards gmake. :)

To Linux eyes, '/usr/home/CanOfBees/Documents/genericWorkspace/HelloWorld/main.cpp' seems a strange filepath. Does it exist? Is it intentional? Do you have the necessary permissions to process files there (in Linux, /usr/ is root-owned)?
Yes to all your questions! Root owns down to home/ and then I have processing permissions below that.
The error mentions line 87, which in the posted code is: -include $(IntermediateDirectory)/*$(DependSuffix). That line is correct for a CodeLite mk file. Is it your line 87? If not, which is?
Yes, that's my line 87.
I hope some that that helps.
Regards,
David
Absolutely! Thank you!
Jarod42 wrote:Which 'make' do you use ?
It seems there are incompatibilities between BSD make and GNU make.

You can change the make used :
In Settings -> Build Settings...
Build Systems,'Build Tool:'.
I'll test this directly! Thank you for the suggestion!

Re: FreeBSD 9.0, "need operator" error -- SOLVED

Posted: Mon Aug 27, 2012 4:30 pm
by CanOfBees
Thanks to Jarod42 & DavidGH for their kind assistance.

For anyone else coming up against this problem in FreeBSD (and not immediately knowing how to fix it)...

Settings > Build settings > Build Systems tab is where you can redirect from the FreeBSD make ([pb]make) to gmake.

Code: Select all

> which gmake
/usr/local/bin/gmake
You can probably key the file path directly, or use the Browse button.

Cheers!
Bridger