orangeduck / Corange

Pure C Game Engine
http://www.youtube.com/watch?v=482GxqTWXtA
Other
1.79k stars 199 forks source link

MAX_PATH undeclared in cengine.h #7

Closed szabba closed 11 years ago

szabba commented 11 years ago

I've just made a clone, the HEAD is at 841fcf6 and when running make I get the following error:

[karol@localhost 13-01-10 21:26 Code/Corange]> make
gcc src/cengine.c -c -I ./include -std=gnu99 -Wall -Werror -Wno-unused -O3 -g -fPIC -o obj/cengine.o
In file included from src/cengine.c:1:0:
./include/cengine.h:39:12: error: ‘MAX_PATH’ undeclared here (not in a function)
make: *** [obj/cengine.o] Błąd 1
orangeduck commented 11 years ago

Hey,

What sort of machine are you compiling on? I think some targets don't have MAX_PATH or PATH_MAX.

If you go into include/SDL/SDL_local.h you should be able to fix the compile error by replacing the relevant section with

#ifdef MAX_PATH
  // Do Nothing
#elif PATH_MAX
  #define MAX_PATH PATH_MAX
#else
  #define MAX_PATH 256
#endif

or something similar.

szabba commented 11 years ago

It's an Acer TravelMate 5742Z with a Pentium P6200 (if that helps you in anything).

After adding the snippet you provided it seems to work. At least the part that previously didn't -- certain object files are apparently lacking:

[karol@localhost 13-01-10 22:54 Code/Corange]> LANG=en_US make
make: *** No rule to make target `obj/SDL_local.o', needed by `libcorange.so'.  Stop.

Should I start a new issue for that though?

orangeduck commented 11 years ago

Sorry I meant more what operating system and compiler etc?

That is a very odd error. The rule to make "obj/SDL_local.o" should be given by:

obj/%.o: src/*/%.c | obj
    $(CC) $< -c $(CFLAGS) -o $@

src/SDL/SDL_local.c does exist in your source tree right?

szabba commented 11 years ago

On 10.01.2013 23:07, Daniel Holden wrote:

Sorry I meant more what operating system and compiler etc?

Arch Linux, GCC

[karol@localhost 13-01-11 8:47 ~]> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.7.2/configure --prefix=/usr 
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man 
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ 
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared 
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit 
--disable-libunwind-exceptions --enable-clocale=gnu 
--disable-libstdcxx-pch --enable-libstdcxx-time 
--enable-gnu-unique-object --enable-linker-build-id --with-ppl 
--enable-cloog-backend=isl --disable-ppl-version-check 
--disable-cloog-version-check --enable-lto --enable-gold 
--enable-ld=default --enable-plugin --with-plugin-ld=ld.gold 
--with-linker-hash-style=gnu --disable-multilib --disable-libssp 
--disable-build-with-cxx --disable-build-poststage1-with-cxx 
--enable-checking=release
Thread model: posix
gcc version 4.7.2 (GCC)

That is a very odd error. The rule to make "obj/SDL_local.o" should be given by:

obj/%.o: src/*/%.c | obj
     $(CC) $< -c $(CFLAGS) -o $@

src/SDL/SDL_local.c does exist in your source tree right?

Yes, it does.

orangeduck commented 11 years ago

Unless you have some old or weird version of Make I can't really work out why this would be happening. I am unable to recreate it on my linux machine (Ubuntu) Do you have any ideas?

ghost commented 11 years ago

I am getting this same issue, running Arch Linux with GCC 4.8.1 with very similar specs to @szabba's. make is GNU Make 3.82. Seems specific to Arch, but I'm totally at a loss for what's causing it. It does seem worth opening as a separate issue, though.

orangeduck commented 11 years ago

Yeah thanks.