Skip to content

Move libraries to the end of the link line#14

Open
flavorjones wants to merge 1 commit intothefloweringash:mainfrom
flavorjones:flavorjones-fix-link-line-library-order
Open

Move libraries to the end of the link line#14
flavorjones wants to merge 1 commit intothefloweringash:mainfrom
flavorjones:flavorjones-fix-link-line-library-order

Conversation

@flavorjones
Copy link
Copy Markdown

Move libraries to the end of the link line to avoid errors like:

g++ -lssl -lcrypto -o sigtool main.o hash.o macho.o signature.o commands.o
/usr/bin/ld: hash.o: in function `SigTool::SHA256Hash::SHA256Hash(unsigned char const*, unsigned long)':
hash.cpp:(.text+0xcc): undefined reference to `SHA256'
collect2: error: ld returned 1 exit status
make: *** [Makefile:18: sigtool] Error 1

The link line is updated to be something like:

g++  -o sigtool main.o hash.o macho.o signature.o commands.o -lssl -lcrypto

to avoid errors like:

```
g++ -lssl -lcrypto -o sigtool main.o hash.o macho.o signature.o commands.o
/usr/bin/ld: hash.o: in function `SigTool::SHA256Hash::SHA256Hash(unsigned char const*, unsigned long)':
hash.cpp:(.text+0xcc): undefined reference to `SHA256'
collect2: error: ld returned 1 exit status
make: *** [Makefile:18: sigtool] Error 1
```

The link line is updated to be something like:

```
g++  -o sigtool main.o hash.o macho.o signature.o commands.o -lssl -lcrypto
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant