Advertising
- sanjin
- Tuesday, January 29th, 2008 at 9:26:12am MST
- # the static library c
- #
- # c.cpp looks like this:
- # int __declspec(dllexport) test()
- # {
- # return 9;
- # }
- lib c
- : c.cpp
- : <link>static
- ;
- # the shared library
- lib a
- : c
- : <link>shared
- ;
- # test executable
- # main.cpp looks like this:
- #
- # int __declspec(dllimport) test();
- #
- # int main()
- # {
- # test();
- # return 0;
- # }
- exe test
- : main.cpp a
- ;
- #E:\Projects\test>bjam --toolset=gcc
- #...found 16 targets...
- #...updating 9 targets...
- #MkDir1 bin\gcc-mingw-3.4.5\debug
- #MkDir1 bin\gcc-mingw-3.4.5\debug\link-static
- #gcc.compile.c++ bin\gcc-mingw-3.4.5\debug\link-static\c.o
- #gcc.archive bin\gcc-mingw-3.4.5\debug\link-static\libc.lib
- #gcc.link.dll bin\gcc-mingw-3.4.5\debug\a.lib
- #Creating library file: bin\gcc-mingw-3.4.5\debug\a.lib
- #gcc.compile.c++ bin\gcc-mingw-3.4.5\debug\main.o
- #gcc.link bin\gcc-mingw-3.4.5\debug\test.exe
- #bin\gcc-mingw-3.4.5\debug\main.o: In function `main':
- #E:/Projects/test/main.cpp:5: undefined reference to `_imp___Z4testv'
- #collect2: ld returned 1 exit status
- #
- # "g++" -Wl,-R -Wl,"E:\Projects\test\bin\gcc-mingw-3.4.5\debug" -Wl,-rpath-li
- #nk -Wl,"E:\Projects\test\bin\gcc-mingw-3.4.5\debug" -o "bin\gcc-mingw-3.4.5\debu
- #g\test.exe" -Wl,--start-group "bin\gcc-mingw-3.4.5\debug\main.o" "bin\gcc-mingw-
- #3.4.5\debug\a.lib" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group -g
- #
- #
- #...failed gcc.link bin\gcc-mingw-3.4.5\debug\test.exe...
- #...failed updating 1 target...
- #...updated 8 targets...
- #
- #E:\Projects\test>
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.