Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1215
  • Last Modified:

Make EXE not use DLL

I am writing a program using glut and I want to send it to a friend. If i just send the EXE, he gets an error message saying that "glut32.dll is not installed" but I dont want to have to send 2 files (the EXE and glut32.dll). How do I build the project so that glut32.dll is not required? Is there a way to do this?
0
wertyk
Asked:
wertyk
  • 11
  • 7
  • 5
  • +6
1 Solution
 
KarcOriginCommented:
Create an Installer with dll added into it and send it to him. He will INSTALL your program which will register the required Dll.

Thx
0
 
wertykAuthor Commented:
i dont really want to make an installer, i just want a standalone exe file that he can run
0
 
KarcOriginCommented:
If you just want to send the .EXE file and not the dll file then there is no way he/she can run it without that dll which is used in your program. But I have one more solution: Ask him to download glut32.dll from the net and register it before running your EXE, by this way you have to send him just your EXE and he/she can also run your program.

:-))

CHEErs!
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
wertykAuthor Commented:
well i can just send him glut32.dll

but there is no way to like "include" in a way glut32.dll inside of the exe?
0
 
wertykAuthor Commented:
like kinda package them together or something like that?
0
 
tzxie2000Commented:
you may try to package it into one winrar selfextract package and set the default running program to your exe file
0
 
aravindtjCommented:
make the project/ application as static.
0
 
Ed_NelsonCommented:
I think you want something like this...

http://www.molebox.com/

-Ed
0
 
wertykAuthor Commented:
aravindtj-
how do i do that?
0
 
wertykAuthor Commented:
Ed-
yeah thats exactly what i want. now can you make it free?
0
 
Ed_NelsonCommented:
If you have visual studio .net This is free
http://www.developerfusion.com/show/4504/

This one you can use but to compress files inside .exe you need to register.
http://www.pgware.com/downloads/?file=alloy.exe&type=trial
So this is the same as creating an installer pkg sizewise anyways.

Another not free but lower cost
http://www.softpedia.com/public/cat/5/2/5-2-19.shtml

Another not free but lower cost
http://www.moonlight-software.com/vbpower.htm

Another not free but lower cost
http://www.worldssp.net/software/VB-PowerWrap.htm

Looks like $49.95 minimun for VB    : /
Free for .net
:)
-Ed

0
 
wertykAuthor Commented:
i cant seem to get ilmerge to work. i put ilmerge in the same directoy as my .exe file, and ran

ilmerge /out:project1merged.exe project1.exe c:\windows\system32\glut32.dll

and it gives me

ILMerge.Merge: There are no assemblies to merge in. Must have been an error in reading them in?
0
 
Ed_NelsonCommented:
Just noticed this does not work with VB.NET, only C#  sry

ilmerge homepage:
http://research.microsoft.com/%7Embarnett/ilmerge.aspx

-Ed

0
 
wertykAuthor Commented:
i'm actually using vc++, but i guess thats not suporrted by ilmerge either.

any other ideas?
0
 
mrwad99Commented:
OK this is very interesting.  I have actually used a program called DLL to LIB that actually converts the DLL code to a static library, that you then link with instead of the normal LIB file.  This program costs, but I downloaded a trial version of it, ran it on a DLL that I created myself and found that I could run the my EXE without the DLL.  When linking with the normal LIB, the DLL was needed.

Download it from http://www.tucows.com/preview/218911.html.  Run it on your DLL, then replace the LIB file you are using currently with the one it generates, #include the header file it generates also, and you should be good to go.

HTH
0
 
XxavierCommented:
tell him to put glut32.dll into google and then down load it into the same folder as the .exe from one of the gazillion hits he will get. ( googling a missing .dll is part of "getting an .exe to work 101" )
0
 
cookreCommented:
DLL to LIB - Claims to be shareware:
http://www.ezgoal.com/channels/developer/f.asp?f=235956
0
 
mrwad99Commented:
cookre:

Hmm.  Interesting.  Well, I figured that shareware has some sort of fee involved somewhere along the line, as opposed to freeware.
0
 
cookreCommented:
The common understanding is that if you like the package and decide to use it regularly, you pay a nominal fee.  Although there is no legal requirement to pay, it is the proper thing to do.

The only gray area is that of single use.  Some contend that one need pay only if the package is to be used regularly.  Others hold that a single successful use warrants payment.

In the end, it's largely a matter of conscience.
0
 
mrwad99Commented:
Indeed, if the questioner decides to use this software then that is up to him.  I expected there to be some limit on it, say in the size of the DLL it can convert, but after converting Kernel32.DLL I don't think that is the case.  

There is probably some time limit on it hence.  It would be highly unusual for the software to be fully working with the vendors only relying on a person's honesty and morals to get payment ;)
0
 
wertykAuthor Commented:
DLL to Lib made glut32.dll into glut32.lib and glut32_supp.h

what do I do with those to make it work?
0
 
cookreCommented:
They need to be explicitly added to the project.

Which compiler are you using, and if applicable, what is the project type?
0
 
cookreCommented:
For what it's worth, I just looked at the GLUT download page:
http://www.opengl.org/resources/libraries/glut/glut_downloads.html
The downloadable glutdlls36.zip already has LIBs in it.
0
 
wertykAuthor Commented:
visual c++ .net 2003
0
 
mrwad99Commented:
There should be something in there that allows you to chose what to link the project with.  You need to add the lib file that was created by DLL to LIB here.  Also #inlcude the header file generated in the main source file too.
0
 
cookreCommented:
Well, poo.  I don't see any options for static linking under that compiler.  For your sake, I hope somebody else can tell you what my bifocals can't find.
0
 
mrwad99Commented:
I don't think that it needs to be linked statically.

What I actually think happens is that the LIB file that contains *all* the source code gets built into the EXE instead of references to the code in the DLL.  I linked mine normally, the only linking explicitly specified was dynamic linking to the MFC DLL when I was using that.
0
 
Wim ten BrinkSelf-employed developerCommented:
Include the DLL in the resource file of your application. (The *.res file) When your application starts, check if the DLL exists. If not, retrieve it from the resource file and write it to disk. When the application ends, delete the DLL from disk again. :-)

If you want to do it more advanced, it is possible to load a DLL just from memory so you don't need to write it to disk. But it's a bit too advanced for me...
0
 
wertykAuthor Commented:
ok, its too much trouble. first person to tell me that it just cant be done gets the points.
0
 
mrwad99Commented:
We need the source code if you want someone to build the application...
0
 
mrwad99Commented:
If *you* are not going to put in the time and the effort to get this to work, then yes, I guess that this cannot be done.  But that is up to you :)
0
 
Wim ten BrinkSelf-employed developerCommented:
I've provided you a way to include the DLL in the executable, so it becomes just a single file. All you need to do when the application starts is check if the DLL is there, if it's the right version and if not then override it with the version in the resource.

Create a file called YourProject.rc and add one line to it: GLUT DATA "glut32.dll"
Then add this file to your project. (By default it allows you to add *.pas files but you can also add *.rc files if you change the filter in the file dialog that you get when you add a file.)
Build the project and it will include the DLL in your executable. (Unless it cannot find glut32.dll which means you have to include the pathname to the DLL in the *.rc file, between the quotes.)

And you need to write code that reads the DLL from the resource (thus from itself) and writes it to disk. That would be all... If your friend later deletes the DLL, the exe will just generate it again...
0
 
wertykAuthor Commented:
points go to alex. thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 11
  • 7
  • 5
  • +6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now