Jump to content

  • Log In with Google      Sign In   
  • Create Account

Nazzrim

Member Since 09 May 2012
Offline Last Active Jan 12 2014 02:13 PM

Posts I've Made

In Topic: Proper DLL use

30 May 2012 - 01:22 AM

DvDmanDT:
Okay, does that mean that the way a library is linked is determined only by the library and not by the way I actual code it? If it does I got it :>.
I didn't know that a library "sets itself" to static/dynamic. Maybe I should get information about DLL's in general.

With this, kept in mind the following sentence I found on SDL site makes sense to me, because now I know that this resulting the dll being a dynamic one.
And if I want to know if a library is dynamic or static I have to examine the library itself.
Helped me a lot. Thank you

Can I use SDL in a commercial application?

Yes! If you link dynamically (via .dll's, .so's or using other dynamic linking devices) then you do not need to to anything. If you link statically (include the SDL source inside your project when you compile) you have to provide some way for your customer to relink your application a custom version of SDL.


In Topic: Proper DLL use

29 May 2012 - 04:51 PM


@Radikalizm
I think I got it now ;-). If I link dynamic there is no need of a Link-flag, because everything gets resolved at runtime. But if I don't want to link dynamic I have to tell the Linker where to look.

If I seperate the #include from the rest in my mind, there is no need of an include statement if I use dynamic link, because then I would be forced to include everything out of the header file.
But how can I get access on classes/flags used inside a DLL.
And not special for SDL: Why can there be more than one linker-flag for one DLL? Can a DLL contain different separated libraries?
Hopefully the last two are not SDL specific and more like "problems of general DLL usage" ;-).


You're still confusing your concepts; as I said, the include statement has absolutely nothing to with linking, so there's no association to be made between static/dynamic linking and including header files.
I think you should maybe pick up a book on programming in C++ to get your concepts straight, a forum isn't exactly the right place to learn all these elementary things Posted Image


Maybe I didn't point out my thoughts clearly: If I use the include statement, the whole content of the header file is included into my executable and because there is no implementation of the functions the Linker will look at the locations I tell it.
I think I nearly understood the concept of include statement / dynamic/static link (will do some practice on that) but maybe I am not able to find the right words...

My actual problem is that I don't know how to handle this information in C++, or: How does a static/dynamic link look in C++?
Until know I thougt thats its static if I use Link-Flags and if not its dynamic.

And yes you are right, I thougt my problem is a lot smaller, but I think I should consider some lecture.
But thank you very much:-).

@DvDmanDT: Thank you. Hopefully got it.

In Topic: Proper DLL use

29 May 2012 - 08:26 AM

@Radikalizm
I think I got it now ;-). If I link dynamic there is no need of a Link-flag, because everything gets resolved at runtime. But if I don't want to link dynamic I have to tell the Linker where to look.

If I seperate the #include from the rest in my mind, there is no need of an include statement if I use dynamic link, because then I would be forced to include everything out of the header file.
But how can I get access on classes/flags used inside a DLL.
And not special for SDL: Why can there be more than one linker-flag for one DLL? Can a DLL contain different separated libraries?
Hopefully the last two are not SDL specific and more like "problems of general DLL usage" ;-).

In Topic: Proper DLL use

29 May 2012 - 05:46 AM

@Radikalizm
Wow, thank you very much. That helps alot :-).
So is it right, that DLL's are designed for dynamic linking, and every use of them is a dynamic link?
I'm not sure if I got it:
I will definitly read about import libraries, but what is the benefit against using #include <...>? Is is, that it would include the whole library instead of only the necessary things?

@kloffy
Thank you I will read it as soon as possible:).
I think I didn't/don't(;-)) understand the meaning of a DLL, because SDL is released with LGPL and it only allows other licences if dynamic linked, so I wanted to learn more about it, poorly the only thing I knew at this point was: "everything comes out of this DLL Oo". So I thought this could be the right way.. But it seems to me that every DLL use is dynamic Oo. Great misunderstanding.

In Topic: [C++] suddenly shutdown on some computers

10 May 2012 - 04:49 AM

Yes it flushes every time:
void Log::log (std:: string message)
{
logger << message << std::endl;
logger.flush();
}

I am not completely sure what the difference between release/debug mode (- maybe someone got sources :S? -).
So I use Notepad++ for coding, and mingw32 via cmd for compiling.
I have a bunch of header files for my classes and .ccp files for the actual classes.
I am compiling it using the command "g++ 'all.ccps' -lSDL -lSDLmain -lSDL_image.
This are my includes DLLs:
libgcc_s_dw2-1.dll
libstdc++-6.dll

libpng15-15.dll
SDL.dll
SDL_image.dll
zlib.dll

The first two are there, because my notebook complains if they are not *shame*
The rest are SDL and related DLLs.

I must concede that my DLL skills tend towards zero, but I really like to improve them. ;-)

PARTNERS