0

I made a application in Netbeans on windows 7. I want to run it on another system but it seems to have lots of dll's it depends on. The compiler tool kit I am using is MinGW, and the first two missing dll's are form that. I only get one missing dll file per run so it is a lot of back and forth to find them all.

Is there a way to list all the dll's that my executable depends on?

Is there a way to compile it so that it does not depend on so many of them (ie compiles the code into the exe)?

Thanks

wkl
  • 77,184
  • 16
  • 165
  • 176
user1404617
  • 585
  • 1
  • 5
  • 20
  • See [MinGW Link Single EXE](http://stackoverflow.com/questions/9222325/mingw-link-single-exe/9222388#9222388). – Jesse Good May 25 '12 at 03:53
  • @JesseGood That will help. I guess I could compile it myself, but is there any way to tell NetBeans to do this? Also is there anyway to find out what libraries I need to link? – user1404617 May 25 '12 at 04:07

1 Answers1

0

From the menu bar, select Menu -> Project Properties. Then in the categories column, expand the node that says Build and select Linker. Then in command line under additional options, add -static-libgcc -static-libstdc++. This will statically link the C and C++ libraries for you. You can also add other libraries with the -static option.

There are tools to help you find dependencies for you, but for windows dlls, I usually just look at MSDN. Here is an SO question that talks about some tools if you want to use them.

Community
  • 1
  • 1
Jesse Good
  • 50,901
  • 14
  • 124
  • 166