<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
The error has changed ;-) No seriously, I stll get an error buiding with CMake:<br><br>/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/../../../../lib64/crt1.o: In function `_start':<br>(.text+0x20): undefined reference to `main'<br><br>Building from the command line works perfect, so I looked what libraries the executable is linked to:<br><br> linux-vdso.so.1 => (0x00007fff331ff000)<br> libgfortran.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/libgfortran.so.1 (0x00007ff22ac5e000)<br> libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/libstdc++.so.6 (0x00007ff22a962000)<br> libm.so.6 => /lib/libm.so.6 (0x00007ff22a6e1000)<br> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007ff22a4d4000)<br> libc.so.6 => /lib/libc.so.6 (0x00007ff22a195000)<br> /lib64/ld-linux-x86-64.so.2 (0x00007ff22aef7000)<br><br>The only library I tell CMake to link to is libgfortran.so. What libraries does CMake usually link to, without specifying?<br><br>greets,<br>Natalie<br><br>> Date: Wed, 10 Jun 2009 02:38:58 -0700<br>> From: denis_scherbakov@yahoo.com<br>> Subject: RE: [CMake] FW: building a mixed language programm with CMake<br>> To: nataliehapp@hotmail.com<br>> CC: cmake@cmake.org<br>> <br>> <br>> > Thanks, that helped, but I still have troubles to set the<br>> > options right:<br>> > Compiling my code "manually", it takes the<br>> > following commands:<br>> > <br>> > gfortran -c hello.f90<br>> > g++ -lgfortran hello.o test.cxx -o test<br>> <br>> Actually this should look like:<br>> gfortran -c hello.f90<br>> g++ -c test.cxx<br>> g++ -lgfortran hello.o test.o -o test<br>> <br>> > Well, that´s my CMakeLists.txt for now:<br>> > <br>> > cmake_minimum_required(VERSION 2.4)<br>> > project(TEST Fortran)<br>> > <br>> > SET(TEST_SRCS test.cxx)<br>> > SET(OBJECTS hello.f90)<br>> <br>> You need to work only with sources. Forget about object files.<br>> Here is your CMakeLists.txt:<br>> <br>> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)<br>> PROJECT(TEST Fortran)<br>> <br>> SET(TEST_SRCS test.cxx hello.f90)<br>> <br>> ADD_EXECUTABLE(test ${TEST_SRCS})<br>> TARGET_LINK_LIBRARIES(test gfortran)<br>> <br>> <br>> # NOT NEDDED: SET_TARGET_PROPERTIES(hi PROPERTIES LINKER_LANGUAGE C)<br>> # NOT NEEDED: CMAKE_EXE_LINKER_FLAGS: -lgfortran -o<br>> # Only if you have one more fortran compiler: CMAKE_Fortran_COMPILER: /usr/bin/gfortran<br>> # NOT NEEDED: CMAKE_Fortran_FLAGS: -c<br>> <br>> > which looks fine, but if my executable is build, where does<br>> > it go? I set the EXECUTABLE_OUTPUT_PATH to the directory<br>> > I´m working in,<br>> > but the executable "hi" does not show up..<br>> <br>> Compiled executable now is in build directory. In your case it should<br>> be in current directory.<br>> <br>> Please, reply to all, so CMake mailing list gets also included.<br>> <br>> Denis<br>> <br>> <br>> <br>> <br><br /><hr />Nuevo Internet Explorer 8 <a href='http://www.ie8.msn.com/microsoft/internet-explorer-8/es-xl/ie8.aspx' target='_new'>ĦEs Gratis y optimizado para MSN!</a></body>
</html>