質問編集履歴
3
fix typo
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
-Wl,--whole-archive \
|
8
8
|
libSample.a \
|
9
9
|
-Wl,--no-whole-archive \
|
10
|
-
-o libCppExe.
|
10
|
+
-o libCppExe.o
|
11
11
|
|
12
12
|
g++ -shared -m64 -Wall -Werror -fPIC \
|
13
13
|
libCppExe.o \
|
2
必要なものを追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
```sh
|
4
4
|
g++ -c -m64 -Wall -Werror \
|
5
5
|
CppExe.cpp \
|
6
|
+
-L /path/to/(libSample.a directory)/ \
|
6
7
|
-Wl,--whole-archive \
|
7
8
|
libSample.a \
|
8
9
|
-Wl,--no-whole-archive \
|
1
不要なものを取り除いた
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
Ubuntu 16.04.1 LTS を使用しています。
|
2
2
|
C++で静的ライブラリ(.a)が存在し、それを取り込んでshared object(.soファイル)を作りたいです。
|
3
3
|
```sh
|
4
|
-
g++ -c -m64 -
|
4
|
+
g++ -c -m64 -Wall -Werror \
|
5
5
|
CppExe.cpp \
|
6
6
|
-Wl,--whole-archive \
|
7
7
|
libSample.a \
|
8
8
|
-Wl,--no-whole-archive \
|
9
9
|
-o libCppExe.so
|
10
10
|
|
11
|
-
g++ -shared -m64 -
|
11
|
+
g++ -shared -m64 -Wall -Werror -fPIC \
|
12
12
|
libCppExe.o \
|
13
13
|
-o libCppExe.so
|
14
14
|
```
|