[CMake] warning: cannot find entry symbol arch_paths_first

sandrews steven.s.andrews at gmail.com
Mon Aug 27 17:00:24 EDT 2012


Hi,

I'm trying to compile a very simple program (called wrl2smol) with CMake. 
This program is a single file of plain C, has no dependencies other than C
standard libraries, and has no graphics.  It's a test for a more complex
program, so I want to get the build system to work with CMake, even if this
isn't the easiest approach.  It builds well for my own machine.  However, I
also want to cross-compile for Windows using MinGW.  Compiling works fine,
but then upon linking, I get the error:

.../i386-mingw32/bin/ld: warning: cannot find entry symbol arch_paths_first;
defaulting to 0000000000401000

If I look at the cmake files, in CMakeFiles/wrl2smol.dir/link.txt, I see
that the linker is called as follows:

/opt/local/bin/i386-mingw32-g++  -O0 -g -Wall -Wl,-search_paths_first
-Wl,-headerpad_max_install_names   CMakeFiles/wrl2smol.dir/wrl2smol.c.o  -o
wrl2smol  -L/opt/local/i386-mingw32/lib

This all seems reasonable to me.  However, the linking returns the above
warning (and the final code doesn't actually work due to the fact that the
starting point isn't found).  What does the error mean?  What should the
linking line say?  And, most importantly to me, how should I fix my CMake
file?

Thank you!
-Steve


The essence of my CMake file is:

#### CMake file ######
project(wrl2smol)
cmake_minimum_required(VERSION 2.6)
set(WRL2SMOL_VERSION "1.0")

set(MAIN_FILES wrl2smol.c)
set_source_files_properties(${MAIN_FILES} PROPERTIES LANGUAGE C )

set (MINGWDIR /opt/local/i386-mingw32)
set (CMAKE_C_COMPILER /opt/local/bin/i386-mingw32-g++)

include_directories(${MINGWDIR}/include)
link_directories(${MINGWDIR}/lib)

add_executable(wrl2smol ${MAIN_FILES})
target_link_libraries(wrl2smol ${DEP_LIBS})











--
View this message in context: http://cmake.3232098.n2.nabble.com/warning-cannot-find-entry-symbol-arch-paths-first-tp7581437.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list