MinGW可能链接到64位dll

时间:2015-01-18 04:06:41

标签: gcc mingw sfml

我试图让SFML与Eclipse一起工作,但我没有成功(运行MinGW 3.17-2和gcc 4.8.1)

该文件已编译但是当我尝试运行它时,我收到以下错误: enter image description here

查看我的MinGW\bin文件夹,我只能看到libgcc_s_dw2-1.dll文件,经过一些搜索后,看来dll要求的是64位版本吗?我的操作系统是64位,但MinGW和SFML库都是32位。

我该如何解决这个问题?

生成文件:

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(CC_DEPS)),)
-include $(CC_DEPS)
endif
ifneq ($(strip $(C++_DEPS)),)
-include $(C++_DEPS)
endif
ifneq ($(strip $(C_UPPER_DEPS)),)
-include $(C_UPPER_DEPS)
endif
ifneq ($(strip $(CXX_DEPS)),)
-include $(CXX_DEPS)
endif
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables 

# All Target
all: Test

# Tool invocations
Test: $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: Cross G++ Linker'
    g++ -L"F:\Libs\SFML-2.2\lib" -o "Test" $(OBJS) $(USER_OBJS) $(LIBS)
    @echo 'Finished building target: $@'
    @echo ' '

# Other Targets
clean:
    -$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(OBJS)$(C_UPPER_DEPS)$(CXX_DEPS)$(C_DEPS)$(CPP_DEPS) Test
    -@echo ' '

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

objects.mk:

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

USER_OBJS :=

LIBS := -lsfml-graphics-d -lsfml-system-d -lsfml-window-d

sources.mk:

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

C_UPPER_SRCS := 
CXX_SRCS := 
C++_SRCS := 
OBJ_SRCS := 
CC_SRCS := 
ASM_SRCS := 
C_SRCS := 
CPP_SRCS := 
O_SRCS := 
S_UPPER_SRCS := 
CC_DEPS := 
C++_DEPS := 
EXECUTABLES := 
OBJS := 
C_UPPER_DEPS := 
CXX_DEPS := 
C_DEPS := 
CPP_DEPS := 

# Every subdirectory with source files must be described here
SUBDIRS := \
. \

subdir.mk

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Add inputs and outputs from these tool invocations to the build variables 
CPP_SRCS += \
../main.cpp 

OBJS += \
./main.o 

CPP_DEPS += \
./main.d 


# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.cpp
    @echo 'Building file: $<'
    @echo 'Invoking: Cross G++ Compiler'
    g++ -I"F:\Libs\SFML-2.2\include" -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
    @echo 'Finished building: $<'
    @echo ' '

1 个答案:

答案 0 :(得分:1)

由于名称修改和非标准化ABI在C ++中的工作方式,遗憾的是不同版本的编译器之间没有兼容性。在您的情况下,您甚至尝试使用使用来自不同的&#34; MinGW&#34;的编译器编译的库。项目比你当前的编译器。但即使你使用相同的&#34;类型&#34;对于编译器,C ++库通常不能在次要版本或补丁版本中重复使用。

我首先建议不要使用原来的MinGW项目,而是选择基于MinGW-w64 project的编译器。如果您想了解相关原因,可以向Google询问,有足够的讨论。

其次,您需要选择与SFML包匹配的编译器,或者您需要自己构建SFML。

第三,如果您想使用最新的编译器版本的SFML的最新开发版本,您可以查看我的Nightly Builds