AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Compile error for my plugin... (https://forums.alliedmods.net/showthread.php?t=48606)

Geesu 12-16-2006 01:03

Compile error for my plugin...
 
Was wondering if anyone could shed some light into the errors i'm coming across when i try to make my project - let me know if you need any more information:

Quote:

hlds@ubuntu:~/HL2SDK/redirect$ make
g++ -I../hl2sdk/public -I../hl2sdk/public/tier1 -I../hl2sdk/public/engine -I../hl2sdk/public/dlls -I../hl2sdk/game_shared -I../hl2sdk/common -I../hl2sdk/dlls -Dstrcmpi=strcasecmp -D_alloca=alloca -w -fpermissive -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp -march=pentium -mmmx -O3 -DARCH=i486 -o obj/MRecipientFilter.o -c MRecipientFilter.cpp
In file included from ../hl2sdk/public/vector.h:35,
from ../hl2sdk/public/edict.h:14,
from ../hl2sdk/public/engine/iserverplugin.h:16,
from MRecipientFilter.cpp:4:
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/xmmintrin.h:34:3: error: #error "SSE instruction set not enabled"
../hl2sdk/public/vector.h:234: error: expected â;â before â&â token
../hl2sdk/public/vector.h:235: error: expected `;' before âconstâ
../hl2sdk/public/vector.h:235: error: expected â;â before â&â token
../hl2sdk/public/vector.h:238: error: expected `;' before âvoidâ
make: *** [obj/MRecipientFilter.o] Error 1
hlds@ubuntu:~/HL2SDK/redirect$
My makefile if it helps:
Quote:

#
# Sample server plugin makefile for SRC engine
# October 2004, [email protected]
#
# Updated by JTP10181, [email protected]
# Version 1.1 - 12/13/04
#

############################################# ################################
# Developer configurable items
############################################# ################################

# the name of the plugin binary after its compiled (_i486.so is appended to the end)
NAME=redirect

# source files that should be compiled and linked into the binary
SRC_FILES = MRecipientFilter.cpp redirect_convar.cpp redirect_main.cpp

# the location of the SDK source code
HL2SDK_SRC_DIR=../hl2sdk

# the directory the base binaries (tier0_i486.so, etc) are located
HL2BIN_DIR=/home/hlds/srcds/bin

# compiler options (gcc 3.4.1 or above is required)
# to find the location for the CPP_LIB files use "updatedb" then "locate libstdc++.a"
CPLUS=g++
CLINK=gcc
CPP_LIB=/usr/lib/gcc/i486-linux-gnu/4.0.3/64/libstdc++.a \
/usr/lib/gcc/i486-linux-gnu/4.0.3/64/libgcc_eh.a \

# put any compiler flags you want passed here
USER_CFLAGS=

# link flags for your mod, make sure to include any special libraries here
LDFLAGS=-lm -ldl tier0_i486.so vstdlib_i486.so

############################################# ################################
# Things below here shouldn't need to be altered
############################################# ################################

# dirs for source code
PLUGIN_SRC_DIR=.
PUBLIC_SRC_DIR=$(HL2SDK_SRC_DIR)/public
TIER0_PUBLIC_SRC_DIR=$(HL2SDK_SRC_DIR)/public/tier0
TIER1_SRC_DIR=$(HL2SDK_SRC_DIR)/tier1

# the dir we want to put binaries we build into
BUILD_DIR=.

# the place to put object files
BUILD_OBJ_DIR=$(BUILD_DIR)/obj
PLUGIN_OBJ_DIR=$(BUILD_OBJ_DIR)
PUBLIC_OBJ_DIR=$(BUILD_OBJ_DIR)/public
TIER0_OBJ_DIR=$(BUILD_OBJ_DIR)/tier0
TIER1_OBJ_DIR=$(BUILD_OBJ_DIR)/tier1

# the CPU target for the build, must be i486 for now
ARCH=i486
ARCH_CFLAGS=-march=pentium -mmmx -O3

# -fpermissive is so gcc 3.4.x doesn't complain about some template stuff
BASE_CFLAGS=-fpermissive -D_LINUX -DNDEBUG -Dstricmp=strcasecmp -D_stricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -D_snprintf=snprintf -D_vsnprintf=vsnprintf -D_alloca=alloca -Dstrcmpi=strcasecmp
SHLIBEXT=so
SHLIBLDFLAGS=-shared

CFLAGS=$(USER_CFLAGS) $(BASE_CFLAGS) $(ARCH_CFLAGS)
#DEBUG=-g -ggdb
#CFLAGS+= $(DEBUG)

INCLUDEDIRS=-I$(PUBLIC_SRC_DIR) -I$(PUBLIC_SRC_DIR)/tier1 -I$(PUBLIC_SRC_DIR)/engine -I$(PUBLIC_SRC_DIR)/dlls -I$(HL2SDK_SRC_DIR)/game_shared -I$(HL2SDK_SRC_DIR)/common -I$(HL2SDK_SRC_DIR)/dlls -Dstrcmpi=strcasecmp -D_alloca=alloca

DO_CC=$(CPLUS) $(INCLUDEDIRS) -w $(CFLAGS) -DARCH=$(ARCH) -o $@ -c $<

############################################# ########################

PLUGIN_OBJS := $(SRC_FILES:%.cpp=$(PLUGIN_OBJ_DIR)/%.o)

PUBLIC_OBJS = \

TIER1_OBJS = \
$(TIER1_OBJ_DIR)/convar.o \
$(TIER1_OBJ_DIR)/interface.o \
$(TIER1_OBJ_DIR)/KeyValues.o \
$(TIER1_OBJ_DIR)/utlbuffer.o \
$(TIER1_OBJ_DIR)/bitbuf.o \

TIER0_OBJS = \
$(TIER0_OBJ_DIR)/memoverride.o \

all: dirs $(NAME)_$(ARCH).$(SHLIBEXT)

dirs:
@if [ ! -f "tier0_i486.so" ]; then ln -s $(HL2BIN_DIR)/tier0_i486.so .; fi
@if [ ! -f "vstdlib_i486.so" ]; then ln -s $(HL2BIN_DIR)/vstdlib_i486.so .; fi
@if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi
@if [ ! -d $(BUILD_OBJ_DIR) ]; then mkdir $(BUILD_OBJ_DIR); fi
@if [ ! -d $(PLUGIN_OBJ_DIR) ]; then mkdir $(PLUGIN_OBJ_DIR); fi
@if [ ! -d $(PUBLIC_OBJ_DIR) ]; then mkdir $(PUBLIC_OBJ_DIR); fi
@if [ ! -d $(TIER0_OBJ_DIR) ]; then mkdir $(TIER0_OBJ_DIR); fi
@if [ ! -d $(TIER1_OBJ_DIR) ]; then mkdir $(TIER1_OBJ_DIR); fi


$(NAME)_$(ARCH).$(SHLIBEXT): $(PLUGIN_OBJS) $(PUBLIC_OBJS) $(TIER0_OBJS) $(TIER1_OBJS)
$(CLINK) $(DEBUG) -o $(BUILD_DIR)/$@ $(SHLIBLDFLAGS) $(PLUGIN_OBJS) $(PUBLIC_OBJS) $(TIER0_OBJS) $(TIER1_OBJS) $(CPP_LIB) $(LDFLAGS)

$(PLUGIN_OBJ_DIR)/%.o: $(PLUGIN_SRC_DIR)/%.cpp
$(DO_CC)

$(PUBLIC_OBJ_DIR)/%.o: $(PUBLIC_SRC_DIR)/%.cpp
$(DO_CC)

$(TIER0_OBJ_DIR)/%.o: $(TIER0_PUBLIC_SRC_DIR)/%.cpp
$(DO_CC)

$(TIER1_OBJ_DIR)/%.o: $(TIER1_SRC_DIR)/%.cpp
$(DO_CC)

clean:
-rm -Rf $(PLUGIN_OBJ_DIR)
-rm -f $(NAME)_$(ARCH).$(SHLIBEXT) tier0_i486.so vstdlib_i486.so

Geesu 12-17-2006 14:25

Re: Compile error for my plugin...
 
Added -msse to compiler flags and still having some errors (for those that come across a similar instruction set error) - thanks BAIL

Will post more if i learn something valuable + could help others

Edit: Used hl2sdk from sourcemm's cvs located here:
http://svn.alliedmods.net/viewvc.cgi...?root=sourcemm

And it worked like a charm :) Was using gcc 4.0.3


All times are GMT -4. The time now is 20:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.