Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

sanjin
Tuesday, January 29th, 2008 at 9:26:12am MST 

  1. # the static library c
  2. #
  3. # c.cpp looks like this:
  4. # int __declspec(dllexport) test()
  5. # {
  6. #       return 9;
  7. # }
  8. lib c
  9.         : c.cpp
  10.         : <link>static
  11.         ;
  12.  
  13. # the shared library   
  14. lib a
  15.         : c
  16.         : <link>shared
  17.         ;
  18.        
  19. # test executable
  20. # main.cpp looks like this:
  21. #
  22. # int __declspec(dllimport) test();
  23. #
  24. # int main()
  25. # {
  26. #       test();
  27. #       return 0;
  28. # }
  29.  
  30. exe test
  31.         : main.cpp a
  32.         ;
  33.  
  34.  
  35. #E:\Projects\test>bjam --toolset=gcc
  36. #...found 16 targets...
  37. #...updating 9 targets...
  38. #MkDir1 bin\gcc-mingw-3.4.5\debug
  39. #MkDir1 bin\gcc-mingw-3.4.5\debug\link-static
  40. #gcc.compile.c++ bin\gcc-mingw-3.4.5\debug\link-static\c.o
  41. #gcc.archive bin\gcc-mingw-3.4.5\debug\link-static\libc.lib
  42. #gcc.link.dll bin\gcc-mingw-3.4.5\debug\a.lib
  43. #Creating library file: bin\gcc-mingw-3.4.5\debug\a.lib
  44. #gcc.compile.c++ bin\gcc-mingw-3.4.5\debug\main.o
  45. #gcc.link bin\gcc-mingw-3.4.5\debug\test.exe
  46. #bin\gcc-mingw-3.4.5\debug\main.o: In function `main':
  47. #E:/Projects/test/main.cpp:5: undefined reference to `_imp___Z4testv'
  48. #collect2: ld returned 1 exit status
  49. #
  50. #    "g++"  -Wl,-R -Wl,"E:\Projects\test\bin\gcc-mingw-3.4.5\debug" -Wl,-rpath-li
  51. #nk -Wl,"E:\Projects\test\bin\gcc-mingw-3.4.5\debug" -o "bin\gcc-mingw-3.4.5\debu
  52. #g\test.exe" -Wl,--start-group "bin\gcc-mingw-3.4.5\debug\main.o" "bin\gcc-mingw-
  53. #3.4.5\debug\a.lib"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group -g
  54. #
  55. #
  56. #...failed gcc.link bin\gcc-mingw-3.4.5\debug\test.exe...
  57. #...failed updating 1 target...
  58. #...updated 8 targets...
  59. #
  60. #E:\Projects\test>

Paste Details

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.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



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.

worth-right