[CMake] Help cmake First project

Rodrigo Faccioli rodrigo.faccioli at gmail.com
Tue Aug 5 11:08:28 EDT 2014


Hi,

Thanks Angeliki and Bill for your attentation.

I have updated my CMakeList.txt based on your post. Below my CMakeList.txt
is showed.

cmake_minimum_required(VERSION 2.8)
# project Information
project(2pg_cartesian)
set(PROJECT_VERSION "1.0")
# add definitions to compiler
add_definitions(-std=c99)
# get all files under directory src
file(GLOB SRC_FILES "src/*.c")
# set include
include_directories(include)
# added libries
add_library(ALL STATIC ${SRC_FILES})
# add target
add_executable(protpred-Gromacs-NSGA2 src/protpred-Gromacs-NSGA2.c)
target_link_libraries(protpred-Gromacs-NSGA2 ALL)

Unfortunatelly, I have received error messages as cited below:
faccioli at faccioli:~/Downloads/2pg_cartesian/build$ make
Scanning dependencies of target ALL
[  2%] Building C object CMakeFiles/ALL.dir/src/protpred-Gromacs-NSGA2.c.o
[  5%] Building C object CMakeFiles/ALL.dir/src/ea_mono.c.o
[  7%] Building C object CMakeFiles/ALL.dir/src/topologyio.c.o
[ 10%] Building C object CMakeFiles/ALL.dir/src/aminoacids.c.o
[ 12%] Building C object CMakeFiles/ALL.dir/src/populationio.c.o
[ 15%] Building C object CMakeFiles/ALL.dir/src/osutil.c.o
[ 17%] Building C object CMakeFiles/ALL.dir/src/aminoacids_io.c.o
[ 20%] Building C object
CMakeFiles/ALL.dir/src/protpred-Gromacs-Sort_Method_Files_by_Front_Dominance.c.o
[ 23%] Building C object CMakeFiles/ALL.dir/src/pdbio.c.o
[ 25%] Building C object CMakeFiles/ALL.dir/src/solution.c.o
[ 28%] Building C object CMakeFiles/ALL.dir/src/vector_math.c.o
[ 30%] Building C object CMakeFiles/ALL.dir/src/math_owner.c.o
[ 33%] Building C object CMakeFiles/ALL.dir/src/protein.c.o
[ 35%] Building C object CMakeFiles/ALL.dir/src/load_parameters.c.o
In file included from
/home/faccioli/Downloads/2pg_cartesian/src/load_parameters.c:7:0:
/home/faccioli/Downloads/2pg_cartesian/include/LoadConfig.h:1:18: fatal
error: string: Arquivo ou diretório não encontrado
compilation terminated.
make[2]: ** [CMakeFiles/ALL.dir/src/load_parameters.c.o] Erro 1
make[1]: ** [CMakeFiles/ALL.dir/all] Erro 2
make: ** [all] Erro 2
faccioli at faccioli:~/Downloads/2pg_cartesian/build$

I did not understand what mistakes I have done since all files share same
structure of directory. In [1] is my project completly. If prefer I can
send its github repository.

I appreciate any help.

Best regards,

[1] https://dl.dropboxusercontent.com/u/4270818/2pg_cartesian_cmake.zip


--
Rodrigo Antonio Faccioli, Ph.D
Development Software for Structural Bioinformatics
Barao de Maua University
University of Sao Paulo
Lindedin - br.linkedin.com/pub/rodrigo-antonio-faccioli/7/589/a5/
Curriculum Lattes - http://lattes.cnpq.br/1025157978990218


On Mon, Aug 4, 2014 at 12:54 PM, Bill Hoffman <bill.hoffman at kitware.com>
wrote:

> On 8/4/2014 10:26 AM, Rodrigo Faccioli wrote:
>
>> protpred-Gromacs-NSGA2.c:(.text+0x1e): undefined reference to
>> `display_msg'
>> protpred-Gromacs-NSGA2.c:(.text+0x3e): undefined reference to
>> `load_parameters_from_file'
>> protpred-Gromacs-NSGA2.c:(.text+0x58): undefined reference to `ea_nsga2'
>> protpred-Gromacs-NSGA2.c:(.text+0x64): undefined reference to
>> `fatal_error'
>> protpred-Gromacs-NSGA2.c:(.text+0x73): undefined reference to
>> `deAllocateload_parameters'
>> protpred-Gromacs-NSGA2.c:(.text+0x7d): undefined reference to
>> `display_msg'
>>
> You have to find out where these symbols are defined.  If you have a
> working Makefile version use nm and grep to find the places.   You can also
> grep your source tree.  You are either missing a source file, or a -D
> option.
>
> Another approach is to run make VERBOSE=1 and compare the build command
> lines to your Makefile build.
>
> -Bill
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140805/d6efd794/attachment-0001.html>


More information about the CMake mailing list