[CMake] Specify 32-bit compilation to Clang

Robert Dailey rcdailey.lists at gmail.com
Mon Jan 19 15:08:39 EST 2015


I have done this and it fails while linking the test program during
configuration:

/usr/bin/ld: cannot find crtbegin.o: no such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s

Any ideas?

On Mon, Jan 19, 2015 at 1:48 PM, Gregor Jasny <gjasny at googlemail.com> wrote:
> Hello Robert,
>
> On 19/01/15 20:42, Robert Dailey wrote:
>> I'm running CMake 3.1 on Mint 64-bit OS. I need to generate an Eclipse
>> project using Ninja that uses Clang to build a 32-bit application.
>>
>> When I do this:
>>
>> add_definitions("-m32")
>>
>> For some reason my code is not able to include STL headers (files not
>> found). Any reason for this? Is there a more proper way to specify
>> 32-bit compilation so STL include paths are set?
>
> You could try setting this two variables at configure time:
> -DCMAKE_C_COMPILER_ARG1=-m32 -DCMAKE_CXX_COMPILER_ARG1=-m32
>
> Hope this helps,
> Gregpor


More information about the CMake mailing list