Issue #96 new

Unable to build due to spaces in file names

Anonymous avatarAnonymous created an issue

I'm using Slackware Linux and GNU make to try and build the tutorials. I can build the glsdk and the framework both in Release and Debug mode. The tutorials fail with this kind of error:

==== Building Tut 08 Gimbal Lock (debug) ====
Creating obj/Debug/Tut 08 Gimbal Lock
g++: error: 08: No such file or directory
g++: error: Gimbal: No such file or directory
g++: error: Lock/GimbalLock.d: No such file or directory
make[1]: *** [obj/Debug/Tut 08 Gimbal Lock/GimbalLock.o] Error 1
make: *** [Tut 08 Gimbal Lock] Error 2

Delving a little deeper, the problem is caused by this line (3rd) in the makefiles:

$(OBJDIR)/GimbalLock.o: GimbalLock.cpp
    @echo $(notdir $<)
    $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"

that produces this kind of command:

g++ -MMD -MP -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DTIXML_USE_STL -DFREEGLUT_STATIC -DLOAD_X11 -D_LIB -DFREEGLUT_LIB_PRAGMAS=0 -DDEBUG -D_DEBUG -I../framework -I../glsdk/glload/include -I../glsdk/glimg/include -I../glsdk/glm -I../glsdk/glutil/include -I../glsdk/glmesh/include -I../glsdk/freeglut/include  -g  -o "obj/Debug/Tut 08 Gimbal Lock/GimbalLock.o" -MF obj/Debug/Tut 08 Gimbal Lock/GimbalLock.d -c "GimbalLock.cpp"

The problem is caused by the whitespace here: '-MF obj/Debug/Tut 08 Gimbal Lock/GimbalLock.d', adding quotes to $(@:%.o=%.d) in the Makefiles would solve the problem.

I couldn't find anyone else with this problem, but I have reproduced it in several machines.

Comments (2)

  1. Jason McKesson

    Unfortunately, this appears to be a Premake4 issue. I don't have control over that project, so there's not much I can do about it.

    My own build under Ubuntu and later Mint seems to work, so I don't know what it is that causes it to not work for you. Are you sure you're using version 4.3 of Premake?

  2. Inês Almeida

    I have version 4.4-beta4 for 64bits of Premake.

    I also don't know why this happens or what to change in the premake config to make it right (I've never used it as a developer). I just used a 'kick and dirty' solution for this: made a script that replaces all occurrences of that token in all Makefiles to include quotes.

    find -name 'Tut*.make' -exec  sed -i 's/-MF $(@:%.o=%.d)/-MF "$(@:%.o=%.d)"/g' {} \;

    A rule for Tut* .make and another for Makefiles inside of the Tut * folders

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.