2 Replies - 267 Views - Last Post: 11 July 2011 - 12:19 PM Rate Topic: -----

#1 grasmanek94  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 11-July 11

Does anyone know how to fix errors with map in GCC/G++?

Posted 11 July 2011 - 12:08 PM

Hello!
I have the following errors when I try to compile my code (in visual C++ 2010 it works nice!):
rafal@ubuntu:~/Desktop/DriftPointsCounter/DriftPointsCounter$ make DriftPointsCounter
rm -f *~ *.o *.so
g++ -D DriftPointsCounter -m32 -fPIC -c -O3 -w -D LINUX -D PROJECT_NAME=\"DriftPointsCounter\" -I ./SDK/amx/ ./SDK/amx/*.c
g++ -D DriftPointsCounter -m32 -fPIC -c -O3 -w -D LINUX -D PROJECT_NAME=\"DriftPointsCounter\" -I ./SDK/amx/ ./SDK/*.cpp
g++ -D DriftPointsCounter -m32 -fPIC -c -O3 -w -D LINUX -D PROJECT_NAME=\"DriftPointsCounter\" -I ./SDK/amx/ *.cpp
In file included from main.cpp:20:0:
./ThirdPartySource/Invoke.cpp: In member function ‘int Invoke::callNative(const PAWN::Native*, ...)’:
./ThirdPartySource/Invoke.cpp:30:76: error: ‘strlen’ was not declared in this scope
./ThirdPartySource/Invoke.cpp: In member function ‘int Invoke::getAddresses()’:
./ThirdPartySource/Invoke.cpp:129:18: error: ‘numeric_limits’ is not a member of ‘std’
./ThirdPartySource/Invoke.cpp:129:38: error: expected primary-expression before ‘int’
./ThirdPartySource/Invoke.cpp:129:38: error: expected ‘)’ before ‘int’
make: *** [DriftPointsCounter] Error 1
rafal@ubuntu:~/Desktop/DriftPointsCounter/DriftPointsCounter$



This is the file (cpp and h):
http://code.google.c...hirdPartySource

This is my makefile:
# This file demonstrates how to compile the DriftPointsCounter project on Linux.
#
# To compile DriftPointsCounter do:
#
# make DriftPointsCounter
#

GPP = g++
GCC = gcc
DriftPointsCounter_OUTFILE = "plugins/DriftPointsCounter.so"

COMPILE_FLAGS = -m32 -fPIC -c -O3 -w -D LINUX -D PROJECT_NAME=\"DriftPointsCounter\" -I ./SDK/amx/

DriftPointsCounter = -D DriftPointsCounter $(COMPILE_FLAGS)

all: DriftPointsCounter

clean:
	-rm -f *~ *.o *.so

DriftPointsCounter: clean
	$(GPP) $(DriftPointsCounter) ./SDK/amx/*.c
	$(GPP) $(DriftPointsCounter) ./SDK/*.cpp
	$(GPP) $(DriftPointsCounter) *.cpp
	$(GPP) -m32 -O2 -fshort-wchar -shared -o $(DriftPointsCounter_OUTFILE) *.o



I'm using the newest ubuntu with all updates (32 bit os).

Is This A Good Question/Topic? 0
  • +

Replies To: Does anyone know how to fix errors with map in GCC/G++?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6036
  • View blog
  • Posts: 23,418
  • Joined: 23-August 08

Re: Does anyone know how to fix errors with map in GCC/G++?

Posted 11 July 2011 - 12:12 PM

./ThirdPartySource/Invoke.cpp:30:76: error: ‘strlen’ was not declared in this scope


strlen requires #include <cstring>

./ThirdPartySource/Invoke.cpp:129:18: error: ‘numeric_limits’ is not a member of ‘std’


std::numeric_limits requires #include <limits>

This post has been edited by JackOfAllTrades: 11 July 2011 - 12:13 PM

Was This Post Helpful? 1
  • +
  • -

#3 grasmanek94  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 48
  • Joined: 11-July 11

Re: Does anyone know how to fix errors with map in GCC/G++?

Posted 11 July 2011 - 12:19 PM

thanks that worked!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1