Raised This Month: $32 Target: $400
 8% 

Module not loaded.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 03-25-2014 , 01:32   Module not loaded.
Reply With Quote #1

Module i compiled is Team Semiclip by claudiuhks.
I used this makefile
Code:
# (C)2004-2013 AMX Mod X Development Team
# Makefile written by David "BAILOPAN" Anderson

###########################################
### EDIT THESE PATHS FOR YOUR OWN SETUP ###
###########################################

HLSDK   = ../../hlsdk
MM_ROOT = ../../metamod/metamod

#####################################
### EDIT BELOW FOR OTHER PROJECTS ###
#####################################

PROJECT = semiclip

OBJECTS = sdk/amxxmodule.cpp semiclip.cpp

##############################################
### CONFIGURE ANY OTHER FLAGS/OPTIONS HERE ###
##############################################

C_OPT_FLAGS     = -DNDEBUG -O2 -funroll-loops -fomit-frame-pointer -pipe
C_DEBUG_FLAGS   = -D_DEBUG -DDEBUG -g -ggdb3
C_GCC4_FLAGS    = -fvisibility=hidden
CPP_GCC4_FLAGS  = -fvisibility-inlines-hidden
CPP             = gcc
CPP_OSX         = clang

LINK =

INCLUDE = -I. -Isdk -Iinclude -I$(HLSDK) -I$(HLSDK)/public -I$(HLSDK)/common -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/pm_shared -I$(HLSDK)/game_shared \
          -I$(MM_ROOT)

################################################
### DO NOT EDIT BELOW HERE FOR MOST PROJECTS ###
################################################

OS := $(shell uname -s)

ifeq "$(OS)" "Darwin"
    CPP = $(CPP_OSX)
    LIB_EXT = dylib
    LIB_SUFFIX = _amxx
    CFLAGS += -DOSX
    LINK += -dynamiclib -lstdc++ -mmacosx-version-min=10.5
else
    LIB_EXT = so
    LIB_SUFFIX = _amxx_i386
    CFLAGS += -DLINUX
    LINK += -shared
endif

LINK += -m32 -lm -ldl

CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32 -DHAVE_STDINT_H -fno-strict-aliasing -m32 -Wall
CPPFLAGS += -fno-exceptions -fno-rtti

BINARY = $(PROJECT)$(LIB_SUFFIX).$(LIB_EXT)

ifeq "$(DEBUG)" "true"
    BIN_DIR = Debug
    CFLAGS += $(C_DEBUG_FLAGS)
else
    BIN_DIR = Release
    CFLAGS += $(C_OPT_FLAGS)
    LINK += -s
endif

IS_CLANG := $(shell $(CPP) --version | head -1 | grep clang > /dev/null && echo "1" || echo "0")

ifeq "$(IS_CLANG)" "1"
    CPP_MAJOR := $(shell $(CPP) --version | grep clang | sed "s/.*version \([0-9]\)*\.[0-9]*.*/\1/")
    CPP_MINOR := $(shell $(CPP) --version | grep clang | sed "s/.*version [0-9]*\.\([0-9]\)*.*/\1/")
else
    CPP_MAJOR := $(shell $(CPP) -dumpversion >&1 | cut -b1)
    CPP_MINOR := $(shell $(CPP) -dumpversion >&1 | cut -b3)
endif

# Clang || GCC >= 4
ifeq "$(shell expr $(IS_CLANG) \| $(CPP_MAJOR) \>= 4)" "1"
    CFLAGS += $(C_GCC4_FLAGS)
    CPPFLAGS += $(CPP_GCC4_FLAGS)
endif

# Clang >= 3 || GCC >= 4.7
ifeq "$(shell expr $(IS_CLANG) \& $(CPP_MAJOR) \>= 3 \| $(CPP_MAJOR) \>= 4 \& $(CPP_MINOR) \>= 7)" "1"
    CFLAGS += -Wno-delete-non-virtual-dtor
endif

# OS is Linux and not using clang
ifeq "$(shell expr $(OS) \= Linux \& $(IS_CLANG) \= 0)" "1"
    LINK += -static-libgcc
endif

OBJ_BIN := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)

# This will break if we include other Makefiles, but is fine for now. It allows
#  us to make a copy of this file that uses altered paths (ie. Makefile.mine)
#  or other changes without mucking up the original.
MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))

$(BIN_DIR)/%.o: %.cpp
    $(CPP) $(INCLUDE) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<

all:
    mkdir -p $(BIN_DIR)
    mkdir -p $(BIN_DIR)/sdk
    $(MAKE) -f $(MAKEFILE_NAME) $(PROJECT)

$(PROJECT): $(OBJ_BIN)
    $(CPP) $(INCLUDE) $(OBJ_BIN) $(LINK) -o $(BIN_DIR)/$(BINARY)

debug:
    $(MAKE) -f $(MAKEFILE_NAME) all DEBUG=true

default: all

clean:
    rm -rf $(BIN_DIR)/*.o
    rm -rf $(BIN_DIR)/sdk/*.o
    rm -f $(BIN_DIR)/$(BINARY)
Module is compiled fine, but it's not loaded. When i type amx_modules it's not showed at all.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 03-27-2014 , 08:33   Re: Module not loaded.
Reply With Quote #2

You have to add the module name in modules.ini

It it doesn't load, in your linux shell type:

ldd addons/amxmodx/modules/yourmodule.so

You will see if you have any missing library
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 03-28-2014 , 03:24   Re: Module not loaded.
Reply With Quote #3

Quote:
Originally Posted by joropito View Post
You have to add the module name in modules.ini

It it doesn't load, in your linux shell type:

ldd addons/amxmodx/modules/yourmodule.so

You will see if you have any missing library
Well it's working that way. But if i remember modules can be auto-loaded if i just place them in modules directory. This one isn't loaded by itself. Am i missing something, or my memory is not that good?
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-28-2014 , 14:37   Re: Module not loaded.
Reply With Quote #4

Modules are automatically loaded if the module has MODULE_LIBRARY defined and a plugin is requesting it to run with #pragma loadlib.
Here's how it's normally used inside the default .inc files:
Code:
#if AMXX_VERSION_NUM >= 175     #pragma reqlib X     #if !defined AMXMODX_NOAUTOLOAD         #pragma loadlib X     #endif #else     #pragma library X #endif
Replace X with whatever MODULE_LIBRARY is defined as.
__________________

Last edited by Black Rose; 03-28-2014 at 14:40.
Black Rose is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 03-28-2014 , 18:44   Re: Module not loaded.
Reply With Quote #5

Try https://forums.alliedmods.net/showthread.php?t=227769's Makefile.
__________________

Last edited by claudiuhks; 03-28-2014 at 18:44.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 03-29-2014 , 03:36   Re: Module not loaded.
Reply With Quote #6

Quote:
Originally Posted by Black Rose View Post
Modules are automatically loaded if the module has MODULE_LIBRARY defined and a plugin is requesting it to run with #pragma loadlib.
Here's how it's normally used inside the default .inc files:
Code:
#if AMXX_VERSION_NUM >= 175     #pragma reqlib X     #if !defined AMXMODX_NOAUTOLOAD         #pragma loadlib X     #endif #else     #pragma library X #endif
Replace X with whatever MODULE_LIBRARY is defined as.
Thanks, didn't know that.

Quote:
Originally Posted by claudiuhks View Post
I'll check it, thanks.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:38.


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