Cannot Compile My Project Using Make

Greetings,

I am running Geant4-11.3 on Linux Mint Xfce. I already added Geant4 source file to my path (i.e, source directory), but sometimes, whenever I run a project from an arbitrary folder in my computer using make, I get this error in terminal,

puyandeh@puyandeh-ideapad330:~/Documents/Geant4Projects/Sensitive Detector$ make
Creating shared library tmp/Linux-g++/example/libexample.so ...
/usr/bin/ld: cannot find Detector/tmp/Linux-g++/example/libexample.so: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/home/puyandeh/Geant4/install/share/Geant4/geant4make/config/common.gmk:56: tmp/Linux-g++/example/libexample.so] Error 1

And here is the thing, I already have examples of Geant4 (made by myself) on my laptop and they work fine using make. But when I copy this whole project into another folder, without changing anything, I get this error.

I recognised that this libexample.so file exists in the specific directory. But as soon as I copy my project to another folder, this file gets deleted. Even if I manually copy this file again and paste it to the relative directory, as soon as I run make, it will be deleted again.

Please help me in this regard as I am in the middle of a very important project. In addition, please do not suggest using cmake, because I get tons of errors as I run cmake.

This is the content of my GNUmakefile,

# $Id: GNUmakefile 68058 2013-03-13 14:47:43Z gcosmo $
# --------------------------------------------------------------
# GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
# --------------------------------------------------------------

name := main
G4TARGET := $(name)
G4EXLIB := true
G4WORKDIR :=.
ifndef G4INSTALL
  G4INSTALL = ../../..
endif

.PHONY: all
all: lib bin

include $(G4INSTALL)/config/binmake.gmk

visclean:
	rm -f g4*.prim g4*.eps g4*.wrl
	rm -f .DAWN_*

In addition, there is no Detector folder in the main folder of my project.

Found the solution. The folder in which your Geant4 project is located MUST NOT have a space between the names. My folder was ‘Sensitive Detector’, I changed it to ‘SensitiveDetector’ and it worked.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.