file not recognized: File format not recognized

后端 未结 2 1580
深忆病人
深忆病人 2021-02-10 21:36

when i run a make file i get this error

\"obj/viojournal.o: file not recognized: File format not recognized collect2: ld returned 1 exit status\"

and the make f

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-10 22:33

    (I would put this suggestion as a comment, but I don't have enough, Reputation yet)

    I ran into this error recently, and I have a couple of suggestions that might help.

    In my case, the makefile(s) in question needed different CFLAGS depending on whether the installation was 64-bit or 32-bit. Here are some lines from the README

    By default, the C/C++ software are compiled in 32 bits with the options (-Os) but can be compiled in 64 bits, -m64 is added to the CFLAGS variable in

    My suggestion is to first try adding -m64 to your CFLAGS. If that doesn't work, delete the -m64 and replace it with -Os.

    That is, first try having the following line:

    CFLAGS = -g3 -Wall -Wextra -fPIC -DREPLICATION_ENABLED -DJOURNALING_ENABLED -m64
    

    Then, from the command line, run

    make clean
    

    Followed by whatever make commands you use for your install.

    If that doesn't work, change the line in question to

    CFLAGS = -g3 -Wall -Wextra -fPIC -DREPLICATION_ENABLED -DJOURNALING_ENABLED -Os
    

    Then make clean and the other make stuff.

    If some of the C objects are 64-bit and some are 32-bit (I don't know if such a situation actually exists), you might have to do something different.

    This worked in my case, details of which you can see here.

    Please comment to let me know if it works for you.

提交回复
热议问题