How create a library? [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How can I make my own GUI library e.g. SFML?
This question is for the purpose of understanding how GUI libraries work, not to actually make my own library.
I asked what I needed to do so. Can I open my editor and write some C++ code, importing some libraries and that's it. Or it's more complicated?

A library is "just" a bunch of classes and functions, so you write it like a normal program. The only thing that is different is when you compile it: you have to create a static/dynamic library file.

Creating a shared and static library with the gnu compiler [gcc] : http://www.adp-gmbh.ch/cpp/gcc/create_lib.html

Related

How do I tell CMake to link the C standard library, not the C++ one? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 months ago.
Improve this question
I have a simple C++ file, but I do not want to use the C++ standard library, just the C one.
Can this be done using CMake? Basically disabling access to the c++ headers, and only allowing linking to the C standard.
You can use target_compile_options(yourprog PRIVATE -nostdinc++) for clang and GCC based toolchains and /X with the path to its STL headers with msvc

Is it possible to generate a lib through the code of a dll? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a C ++ project that when compiled turns into a dll. Is it possible for me to compile the same code and generate a static lib?
If possible, would I have to change a lot of the code structure?
Is it possible to generate a lib through the code of a dll?
Yes.
Would I have to change a lot of the code structure?
If done right : not really.
Your dll-header(s) probably makes the distiction for importing and exporting declarations/definitions.
You need to make a third distinction for non-dll usage (no importing exporting).
The biggest change would probably involve separating your projects structure.

Drawing graphics without any library in C/C++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Basically is there any way to render a pixel using C/C++ without using any external library. All mingw or gcc headers may be used.
You cannot render images to the screen without external libraries, unless you do hardcore system programming (see for instance this answer fore more information). But you can easily render images that you can save as PNG/JPEG/TIF files, which is what I believe this library is doing.

OpenCV (or similar library) in Go [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I intend to use OpenCV for a project in which I've already built the server in Go. However, OpenCV doesn't have a Go API, so what's the best solution? Call a c++ program with .exec, use swig, find another library to do computer vision?
Thanks.
Edit: I want to maximize performance, and I'm ok with C++.
SWIG is certainly a viable option.
You can also search for a Go binding to OpenCV. For example: https://github.com/lazywei/go-opencv

How to output to console window without iostream in c++? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm a beginner C++ programmer.I would like to know that Is it possible to output to console windows without using iostream header file?
the answer of the question is actually Yes ! but How?
You can always delve down to the C library level, using e.g. printf.
If you don't want to use the standard library at all then you have to use platform-specific functionality. In Windows there are many layers here, much like the C++ versus C layers in the standard library. The highest Windows API layer is the WriteFile function, and below that, WriteConsole, then perhaps WriteConsoleOutput, so on, check it out.
Note that there are at least two open source projects to provide more reasonable console functionality in Windows, namely Console2 at SourceForge and mintty at Google Code.