0

我使用 MinGW+msys。

我正在尝试按照以下说明安装 OpenCASCADE。

https://sites.google.com/site/philippeguerville/home/build-opencascade-for-windows-with-mingw

我已经安装了libpng freeglut FreeImage freetypegl2ps并且oce已经离开了。

现在我在makegl2ps 时遇到问题,出现如下错误。

[ 50%] Linking C executable gl2psTest.exe
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o:(.text+0x1bc): undefined r
eference to `__cpu_features_init'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o:(.text+0x1cb): undefined r
eference to `_CRT_fmode'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o:(.text+0x1ee): undefined r
eference to `_CRT_fmode'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o:(.text+0x202): undefined r
eference to `_CRT_fmode'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../crt2.o:(.text+0x26c): undefined r
eference to `_CRT_glob'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [gl2psTest.exe] Error 1
make[1]: *** [CMakeFiles/gl2psTest.dir/all] Error 2
make: *** [all] Error 2

_cpu_features_init _CRT_fmode _CRT_glob那些定义在哪里?

有没有要定义的头文件_cpu_features_init _CRT_fmode _CRT_glob

make g1lps用以下命令。

cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local -DZLIB_INCLUDE_DI
R=/C/Qt/Qt5.5.0/Tools/mingw492_32/i686-w64-mingw32/include -DZLIB_LIBRARY=/C/Qt
/Qt5.5.0/Tools/mingw492_32/i686-w64-mingw32/lib/libz.a -DGLUT_INCLUDE_DIR=/usr/
local/include -DGLUT_glut_LIBRARY=/usr/local/lib/libglut.dll.a -DPNG_PNG_INCLUD
E_DIR=/usr/include -DPNG_LIBRARY=/usr/local/lib/libpng.a

Makefile 生成如下,主要关注 gl2psTest。

#=============================================================================
# Target rules for targets named gl2psTest

# Build rule for target.
gl2psTest: cmake_check_build_system
    $(MAKE) -f CMakeFiles/Makefile2 gl2psTest
.PHONY : gl2psTest

# fast build rule for target.
gl2psTest/fast:
    $(MAKE) -f CMakeFiles/gl2psTest.dir/build.make CMakeFiles/gl2psTest.dir/build
.PHONY : gl2psTest/fast

# target to build an object file
gl2psTest.obj:
    $(MAKE) -f CMakeFiles/gl2psTest.dir/build.make CMakeFiles/gl2psTest.dir/gl2psTest.obj
.PHONY : gl2psTest.obj

# target to preprocess a source file
gl2psTest.i:
    $(MAKE) -f CMakeFiles/gl2psTest.dir/build.make CMakeFiles/gl2psTest.dir/gl2psTest.i
.PHONY : gl2psTest.i

# target to generate assembly for a file
gl2psTest.s:
    $(MAKE) -f CMakeFiles/gl2psTest.dir/build.make CMakeFiles/gl2psTest.dir/gl2psTest.s
.PHONY : gl2psTest.s

下面还有 CMakeFiles/gl2psTest.dir/build.make。

# CMAKE generated file: DO NOT EDIT!
# Generated by "MSYS Makefiles" Generator, CMake Version 3.3

# Delete rule output on recipe failure.
.DELETE_ON_ERROR:


#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:


# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list


# Suppress display of executed commands.
$(VERBOSE).SILENT:


# A target that is always out of date.
cmake_force:

.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /c/MinGW/msys/1.0/local/bin/cmake.exe

# The command to remove a file.
RM = /c/MinGW/msys/1.0/local/bin/cmake.exe -E remove -f

# Escaping for special characters.
EQUALS = =

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /C/src/products/oss/gl2ps-1.3.8-source

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /C/src/products/oss/gl2ps-1.3.8-source

# Include any dependencies generated for this target.
include CMakeFiles/gl2psTest.dir/depend.make

# Include the progress variables for this target.
include CMakeFiles/gl2psTest.dir/progress.make

# Include the compile flags for this target's objects.
include CMakeFiles/gl2psTest.dir/flags.make

CMakeFiles/gl2psTest.dir/gl2psTest.obj: CMakeFiles/gl2psTest.dir/flags.make
CMakeFiles/gl2psTest.dir/gl2psTest.obj: CMakeFiles/gl2psTest.dir/includes_C.rsp
CMakeFiles/gl2psTest.dir/gl2psTest.obj: gl2psTest.c
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/C/src/products/oss/gl2ps-1.3.8-source/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/gl2psTest.dir/gl2psTest.obj"
    /c/MinGW/bin/gcc.exe  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/gl2psTest.dir/gl2psTest.obj   -c /C/src/products/oss/gl2ps-1.3.8-source/gl2psTest.c

CMakeFiles/gl2psTest.dir/gl2psTest.i: cmake_force
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/gl2psTest.dir/gl2psTest.i"
    /c/MinGW/bin/gcc.exe  $(C_DEFINES) $(C_FLAGS) -E /C/src/products/oss/gl2ps-1.3.8-source/gl2psTest.c > CMakeFiles/gl2psTest.dir/gl2psTest.i

CMakeFiles/gl2psTest.dir/gl2psTest.s: cmake_force
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/gl2psTest.dir/gl2psTest.s"
    /c/MinGW/bin/gcc.exe  $(C_DEFINES) $(C_FLAGS) -S /C/src/products/oss/gl2ps-1.3.8-source/gl2psTest.c -o CMakeFiles/gl2psTest.dir/gl2psTest.s

CMakeFiles/gl2psTest.dir/gl2psTest.obj.requires:

.PHONY : CMakeFiles/gl2psTest.dir/gl2psTest.obj.requires

CMakeFiles/gl2psTest.dir/gl2psTest.obj.provides: CMakeFiles/gl2psTest.dir/gl2psTest.obj.requires
    $(MAKE) -f CMakeFiles/gl2psTest.dir/build.make CMakeFiles/gl2psTest.dir/gl2psTest.obj.provides.build
.PHONY : CMakeFiles/gl2psTest.dir/gl2psTest.obj.provides

CMakeFiles/gl2psTest.dir/gl2psTest.obj.provides.build: CMakeFiles/gl2psTest.dir/gl2psTest.obj


# Object files for target gl2psTest
gl2psTest_OBJECTS = \
"CMakeFiles/gl2psTest.dir/gl2psTest.obj"

# External object files for target gl2psTest
gl2psTest_EXTERNAL_OBJECTS =

gl2psTest.exe: CMakeFiles/gl2psTest.dir/gl2psTest.obj
gl2psTest.exe: CMakeFiles/gl2psTest.dir/build.make
gl2psTest.exe: libgl2ps.a
gl2psTest.exe: C:/MinGW/msys/1.0/local/lib/libglut.dll.a
gl2psTest.exe: c:/Qt/Qt5.5.0/Tools/mingw492_32/i686-w64-mingw32/lib/libz.a
gl2psTest.exe: C:/MinGW/msys/1.0/local/lib/libpng.a
gl2psTest.exe: c:/Qt/Qt5.5.0/Tools/mingw492_32/i686-w64-mingw32/lib/libz.a
gl2psTest.exe: C:/MinGW/msys/1.0/local/lib/libpng.a
gl2psTest.exe: CMakeFiles/gl2psTest.dir/linklibs.rsp
gl2psTest.exe: CMakeFiles/gl2psTest.dir/objects1.rsp
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/C/src/products/oss/gl2ps-1.3.8-source/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking C executable gl2psTest.exe"
    /c/MinGW/msys/1.0/local/bin/cmake.exe -E remove -f CMakeFiles/gl2psTest.dir/objects.a
    /c/MinGW/bin/ar.exe cr CMakeFiles/gl2psTest.dir/objects.a @CMakeFiles/gl2psTest.dir/objects1.rsp
    /c/MinGW/bin/gcc.exe  -O2 -g -DNDEBUG  -mwindows -Wl,--whole-archive CMakeFiles/gl2psTest.dir/objects.a -Wl,--no-whole-archive  -o gl2psTest.exe -Wl,--out-implib,libgl2psTest.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles/gl2psTest.dir/linklibs.rsp

# Rule to build all files generated by this target.
CMakeFiles/gl2psTest.dir/build: gl2psTest.exe

.PHONY : CMakeFiles/gl2psTest.dir/build

CMakeFiles/gl2psTest.dir/requires: CMakeFiles/gl2psTest.dir/gl2psTest.obj.requires

.PHONY : CMakeFiles/gl2psTest.dir/requires

CMakeFiles/gl2psTest.dir/clean:
    $(CMAKE_COMMAND) -P CMakeFiles/gl2psTest.dir/cmake_clean.cmake
.PHONY : CMakeFiles/gl2psTest.dir/clean

CMakeFiles/gl2psTest.dir/depend:
    $(CMAKE_COMMAND) -E cmake_depends "MSYS Makefiles" /C/src/products/oss/gl2ps-1.3.8-source /C/src/products/oss/gl2ps-1.3.8-source /C/src/products/oss/gl2ps-1.3.8-source /C/src/products/oss/gl2ps-1.3.8-source /C/src/products/oss/gl2ps-1.3.8-source/CMakeFiles/gl2psTest.dir/DependInfo.cmake --color=$(COLOR)
.PHONY : CMakeFiles/gl2psTest.dir/depend
4

0 回答 0