CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Makefile options to compile for 64 bit

  1. #1
    Join Date
    Mar 2014
    Posts
    4

    Makefile options to compile for 64 bit

    Hi All,

    I have called a C function inside C++ code. The .so which gets created is a 32 bit while I am looking for 64 bit . What all options should be mentioned in the Make file to eventually compile and get shared object of ELF64 CLASS ?

    Excerpts from Makefile
    -----------------------------

    CC = gcc
    CXX = g++
    CPPFLAGS = -I. -I$(S) -DHAVE_CONFIG_H
    CFLAGS = -O2 -pipe
    CXXFLAGS = -g -O2
    LDFLAGS =
    LIBS = -lsocket -lnsl
    RM = rm -f
    CP = cp
    RMDIR = rmdir
    SHTOOL = $(S)/shtool
    LIBTOOL = $(C)/libtool
    TRUE = true
    POD2MAN = pod2man
    PERL = /usr/bin/perl
    PHP = NA
    PG_CONFIG = /usr/bin/pg_config

    -------------------------------------------

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: Makefile options to compile for 64 bit

    -m64 should be sufficient if you have a multilib (that contains standard libs in both 32/64 bits) gcc installed
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)