Cannot compile under FreeBSD

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Fred Nicolier

Cannot compile under FreeBSD

Post by Fred Nicolier »

I cannot compile Context Free under my FreeBSD box. Using gmake it gives :

--
fredn:~/tmp/ContextFree> gmake
g++ -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -O3 -c -o objs/cfdg.o src-common/cfdg.cpp
src-common/cfdg.cpp: In method `Renderer::~Renderer()':
src-common/cfdg.cpp:241: implicit declaration of function `int unlink(...)'
gmake: *** [objs/cfdg.o] Erreur 1
--

So i has #include <unistd.h> in cfdg.cpp. And now :

--
fredn:~/tmp/ContextFree> gmake
g++ -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -O3 -c -o objs/cfdg.o src-common/cfdg.cpp
g++ -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -O3 -c -o objs/yglue.o src-common/yglue.cpp
src-common/yglue.cpp:21: `FILE' was not declared in this scope
src-common/yglue.cpp:21: `new_file' was not declared in this scope
src-common/yglue.cpp:21: variable or field `yyrestart' declared void
src-common/yglue.cpp: In function `void yg_Reset(...)':
src-common/yglue.cpp:106: `yyrestart' cannot be used as a function
gmake: *** [objs/yglue.o] Erreur 1
--

So before I dive into the code, has someone ever compiled under FreeBSD ?

Fred

Fred Nicolier

RESOLVED

Post by Fred Nicolier »

Ok, after a few modification of the codes (essentially some #include), the compilation is ok

johan

details

Post by johan »

Fred,

Which #includes did you need?

User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Yes, please post your diffs so that this problem can be avoided in the future.

gjunell

FreeBSD, make fails

Post by gjunell »

make is complaining under FreeBSD

Anyone seen this one?


mordred.punk.net>uname -a
FreeBSD mordred.punk.net 5.2.1-RELEASE-p8 FreeBSD 5.2.1-RELEASE-p8 #0: Fri Jun 25 14:54:12 PDT 2004
root@mordred.punk.net:/usr/obj/usr/src/sys/MORDRED i386

mordred.punk.net>make
"Makefile", line 17: Need an operator
"Makefile", line 18: Need an operator
Error expanding embedded variable.
mordred.punk.net>

User avatar
MtnViewJohn
Site Admin
Posts: 875
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

Does the version of make that you are running support the vpath directive? Lines 17 and 18 are the vpath directive lines. Your version of make seems to want VPATH variables instead. Try commenting them out and replacing them with:

Code: Select all

VPATH = $(SRC_DIRS)

goose121
Posts: 4
Joined: Mon Jun 19, 2017 6:59 pm

Re: Cannot compile under FreeBSD

Post by goose121 »

The problem that gjunell was having is easily solved: you must use gmake, not make. FreeBSD's default make is called pmake, and is less commonly used, so if you see a bunch of "Need an operator" errors when trying to compile something, try using gmake

Post Reply