GCC ve makefile kullanarak Windows üzerinde bir C++ programı derlemeye çalışıyorum.hata: '_hypot' bu kapsamda bildirilmedi
aşağıdaki hatayı
c:\mingw\include\math.h: In function 'float hypotf(float, float)':
c:\mingw\include\math.h:635:30: error: '_hypot' was not declared in this scope
{ return (float)(_hypot (x, y)); }
alıyorum ben GCC üzerinde içeren herhangi bir dosya lm bağlayıcı işareti ihtiyacı olduğunu okudum. Yani
İşte bu, sabit fakat kullanarak MinGW bir hata bulamadık benim makefile
CC := g++
CFLAGS := -std=c++0x -g -O2 -static-libgcc -static-libstdc++
LFLAGS := -lm
BIN_DIR := bin
BUILD_DIR := build
SRC_DIR := src
MAIN := MyFirstVstMain
TARGET := MyFirstVstMake
SOURCES := $(wildcard src/*.cpp)
OBJECTS := $(SOURCES:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
$(BIN_DIR)/$(TARGET): CREATE_DIRS $(BUILD_DIR)/$(MAIN).o $(OBJECTS)
$(CC) $(OBJECTS) $(CFLAGS) -o [email protected] $(LFLAGS)
$(BUILD_DIR)/$(MAIN).o: $(SRC_DIR)/MyFirstVstMain.cpp
$(CC) $(CFLAGS) -c -o [email protected] $< $(LFLAGS)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/%.h
$(CC) $(CFLAGS) -c -o [email protected] $< $(LFLAGS)
CREATE_DIRS:
if not exist $(BIN_DIR) mkdir $(BIN_DIR)
if not exist $(BUILD_DIR) mkdir $(BUILD_DIR)
CLEAN:
if exist $(BUILD_DIR) rmdir /Q /S $(BUILD_DIR)
Görünüşe MinGW bir hata: http://ehc.ac/p/mingw/bugs/2250/ –
Bunu nasıl halledebilirim. Math.h kullanan bir üçüncü taraf kitaplığı kullanıyorum. Özellikle steinberg vst sdk. – ScottF
Yani bir kod örneği nasıl olur? Makefile, CFLAGS –