Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: 3DModelerMan on September 14, 2008, 05:13:38 pm

Title: looking for a dll
Post by: 3DModelerMan on September 14, 2008, 05:13:38 pm
Hi, I was wondering if there was a way I could change the directory the application searches for dll's in?.
Thanks :D.
Title: Re: looking for a dll
Post by: stahta01 on September 14, 2008, 06:11:36 pm
Yes

On Windows, the PATH system variable can be set to where to find the DLL.

Tim S
Title: Re: looking for a dll
Post by: MortenMacFly on September 15, 2008, 08:53:31 am
You can also setup in the project options that the application runs in the folder where the DLL's are.
Title: Re: looking for a dll
Post by: 3DModelerMan on September 17, 2008, 11:21:44 pm
Okay thanks, I'll do that.
Title: Re: looking for a dll
Post by: 3DModelerMan on September 19, 2008, 05:13:32 pm
I looked in the project settings and the build options areas but could'nt find the path variable.
Could someone point me to it?.
Thanks.
Title: Re: looking for a dll
Post by: Jenna on September 19, 2008, 05:31:10 pm
Yes

On Windows, the PATH system variable can be set to where to find the DLL.

Tim S

As Tim wrote it's a system variable.

You can e.g. google for :"how to set path on windows" (gives me more then a million responses).
Title: Re: looking for a dll
Post by: stahta01 on September 19, 2008, 05:36:58 pm
I looked in the project settings and the build options areas but could'nt find the path variable.
Could someone point me to it?.
Thanks.

The PATH variable is part of windows not part of Code::Blocks.
Note: The EnvVars plugin can set the window PATH variable, but I never trusted it to confirm it works.

I do use "Settings" -> "Compiler and Debugger"
Tab "ToolChain exe"
SubTab "Additional paths"
In order for Executables and DLL not created by my project can be found.

Tim S
Title: Re: looking for a dll
Post by: 3DModelerMan on September 19, 2008, 07:27:57 pm
oh, thanks.
Title: Re: looking for a dll
Post by: rcoll on September 20, 2008, 02:30:56 am
I looked in the project settings and the build options areas but could'nt find the path variable.
Could someone point me to it?.
Thanks.

The PATH variable is part of windows not part of Code::Blocks.
Note: The EnvVars plugin can set the window PATH variable, but I never trusted it to confirm it works.

I do use "Settings" -> "Compiler and Debugger"
Tab "ToolChain exe"
SubTab "Additional paths"
In order for Executables and DLL not created by my project can be found.

Tim S

Note that this will only work properly when you run your application from within C::B.

To make it work outside of C::B, open your Control Panel, select System, then the "Advanced" tab.  At the bottom is a button that says "Environment Variables".  Click that and edit your PATH variable to include the directory where you DLL's exist.

Ringo
Title: Re: looking for a dll
Post by: 3DModelerMan on September 20, 2008, 11:48:16 pm
I just thought of something though, won't this affect the rest of my computers programs?.
I have windows XP so if my installer wrote in XP to system32 (wich is where my dll's are searched for), if the install program wrote the dll's to there would it be the same on other windows systems?.
Title: Re: looking for a dll
Post by: stahta01 on September 21, 2008, 12:12:27 am
I just thought of something though, won't this affect the rest of my computers programs?.
I have windows XP so if my installer wrote in XP to system32 (wich is where my dll's are searched for), if the install program wrote the dll's to there would it be the same on other windows systems?.

If your installer puts any DLLs into system32 other than windows DLLs; I hope to never use your program.
This assumes an normal program; some system utilities seem to put DLLs there, but most other programs do not.

http://en.wikipedia.org/wiki/Dll_hell

http://msdn.microsoft.com/en-us/library/ms682586.aspx

Tim S
Title: Re: looking for a dll
Post by: J!M! on September 21, 2008, 09:57:15 pm
I'm new to Code::Blocks.

In the systems PATH-variable I added "C:\QtOpenSource\bin", which works fine within "QDevelop". But now, in Code::Blocks the compiler just can't find Qt. (I want to build a DLL from sources which use Qt.) Why?

Btw: Why is in Project->Properties some text as black as the background, so that I can't read it?

GreezZ J!M!
Title: Re: looking for a dll
Post by: stahta01 on September 21, 2008, 10:12:43 pm
Try adding the dll path to Code::Blocks in addition to the Windows System Variable PATH.


The method I use is to add it to Global Compiler Settings.
"Settings" -> "Compiler and Debugger"
Tab "Tool chain exe"
SubTab "Additional paths"

Tim S
Title: Re: looking for a dll
Post by: J!M! on September 21, 2008, 10:19:05 pm
Thx 4 your answer.

But I've already tried that without success. Check out the screenshots in the attachment.

Greezz J!M!

[attachment deleted by admin]
Title: Re: looking for a dll
Post by: stahta01 on September 21, 2008, 10:25:50 pm
Please try it again this time use
SubTab "Additional paths"

Oops, not sure which tab is highlighted in your pic.

FYI: You also need to update the project search folders, but since that has nothing to do with finding the DLL on program execution, not sure if it needs stated.

Tim S
Title: Re: looking for a dll
Post by: J!M! on September 21, 2008, 10:28:30 pm
"AdditionalPaths" is highlighted.

Thatz also my 2nd problem: Why do I have a such weird color distribution?
Title: Re: looking for a dll
Post by: stahta01 on September 21, 2008, 10:34:30 pm
Btw: Why is in Project->Properties some text as black as the background, so that I can't read it?

GreezZ J!M!

Because you selected an black background; somewhere in Code::Blocks there is an bug.

Tim S
Title: Re: looking for a dll
Post by: J!M! on September 21, 2008, 10:43:48 pm
Hmm.. Isn't there a patch for this? This really gets on my nerves...

But what is with my main problem? Isn't there other solution?
Ok, what I've thought: Even it is a Qt project, I've started up by making a "Dynamic Link Library"-Project. Maybe thatz the reason why C::B can't find Qt. But if then I choose "Qt Application", am I still able not to compile an .exe but a .dll, by changing build/project-options afterwards?
Title: Re: looking for a dll
Post by: stahta01 on September 21, 2008, 10:54:42 pm
Hmm.. Isn't there a patch for this? This really gets on my nerves...

But what is with my main problem? Isn't there other solution?
Ok, what I've thought: Even it is a Qt project, I've started up by making a "Dynamic Link Library"-Project. Maybe thatz the reason why C::B can't find Qt. But if then I choose "Qt Application", am I still able not to compile an .exe but a .dll, by changing build/project-options afterwards?

Sounds more and more that you did not set the project search folder correctly, please confirm they are right.

Turn on Compiler logging and post the results.
This is done by selecting the "Full command line" option Under menu "Settings" -> "Compiler and Debugger" -> "Other Setting" tab, "Compiler logging".

What is the error?

Is it an compiler error, linker error or runtime error?

Tim S
Title: Re: looking for a dll
Post by: J!M! on September 21, 2008, 11:11:39 pm
WTF!
Don't know w2do.... -.-
-> screenshot

[attachment deleted by admin]
Title: Re: looking for a dll
Post by: Jenna on September 21, 2008, 11:42:31 pm
Instead of "Task descripting" chose "Full commandline" from the dropdown list.