Simple questions about how c++ works

Be free to answer only the questions you want:

1- A .dll is written in wich language?

2- A library like curl is written in c++, but if it's were all in c++ so we wouldn't need a library for it, rigth? So I think it uses dlls (that are written in another language), is it rigth?

3 - How do I link curl in code blocks? I only need to link the files in code blocks? No system installation needed?

4 - If I compile something that uses a library, will it run normally in other computers?

5 - If I want to compile something in windows that can run in it but also in linux, is it possible? (without using the specific libraries for windows, of course)

6 - How do I add a icon to my .exe application? Has it a rigth way to do?

7 - How do I close the console (the black screen) of my window application without closing the window itself?

8 - If I create an OpenGL, GLUT application, the user will have to install something to run my .exe compiled file?

9 - When a program is compiled, it is compiled to a machine language. How do I know in wich machines it will run?

10 - What's the meaning of life?


Thanks :D
1. Not being a windows programmer I could be wrong but a .dll can be written in C++ or in C# or whatever other .NET language and it can use the Common Object Model to use it in different languages. If this is wrong please correct me.

2. Not sure never used curl, you would need a library for it if it was written in C++ however because its not part of the standard library

3. Don't know

4. It will provided that library is on other libraries that the program wants to run on(assuming its dynamically linked) if its statically linked into the program then you will not need that library on the other computer and also the program can only run on the same platform it was compiled on.

5. No this is not possible, the code needs to be recompiled in Linux assuming its cross platform code.

6. I think you can right click on the .exe and add it through properties

7. Don't know. Once again don't program in Windows.

8. They will need the OpenGL and GLUT runtime libraries to run it

9. It is compiled into native machine code assuming its not a language that runs on a virtual machine like Java or an interpreted language like Python(although interpreted languages aren't compiled. It will run on the platform its compiled on. Linux compiled programs will run on Linux only and Windows compiled programs on Windows only.

10. 42 :)
1. I have written DLL files in C++, I don't know if it is possible with other languages.
2. I don't understand what you mean, all is already in c++
3. I don't know what the curl library is
4. It depends. If you use cross-platform libraries, then it will.
5. It depends, If your program uses a library that is compatible with Linux and your compiler also has support for Linux, then it is possible.
6. That is done using the Windows API or you can add it directly with your compiler, if it has that feature. For example, DevCpp allowed me to use an icon without writing additional code, but it is a deprecated IDE.
7. If you use Microsoft Visual C++, go to Project Options - Linker - System and set Subsystem to Windows, not console. Then that annoying console will no longer popup, just your window will do.
8. I don't know, I've never worked with OpenGL.
9. You mean, running it on a machine that is not a PC? then, I don't know.
10. 42

Topic archived. No new replies allowed.