[CMake] help with shared-lib make failure

luxInteg lux-integ at btconnect.com
Sat Jun 16 04:45:56 EDT 2012


Greetings,

Its been about 1 year since  since I had a go at learning cmake.
My current setup has these:- OS 64bit(AMD) cblfs linux, gcc-4.4.2, cmake-2.8.7

This is my current problem:
My project has a  file  call this file1.c.  
CMake is used o generate makefile etc 

When make  compiles file1.c  it compiles it to  file1.c.o

I have these directives in the CMake script

--1--add_library(file1-static  file1.c)
--2--add_library(file1  shared file1.c)

--1-- executes and genetates a static library but  with --2-- I now get the 
error 

usr/bin/ld/CMakeFiles/... file1.c.o  file format not recognised  treating as a 
linker script
usr/bin/ld/CMakeFiles/... file1.c.o:1 syntax error
collect2 ld returned 1 exit status


I never had this problem before so advice on what I  have wrong or doing wrong 
would be much appreciated.

sincerely
lux-integ


More information about the CMake mailing list