C/C++ :: Reducing Windows Library Size?

Sep 30, 2013

I am using

#include <vector>
#include <map>  

In my c++ project, and these 2 header files are included in almost 200 .cpp files and when i build a static library for the whole project in linux its size is around 10MB and when i did the same thing in windows its size is almost over 80MB, and one thing i noticed was both vector and map combinely takes 500KB in each .cpp file in windows. I am building the static library in windows using release mode.

I am using VS 2007. Any way to reduce the library size.

View 2 Replies


ADVERTISEMENT

C++ :: Reducing The Size Of A Compiled Executable For Easier Distribution?

Jun 19, 2014

I am looking at reducing the size of a compiled executable for easier distribution.

What factors affect the size of an output executable?

Would literally having defined and implemented less functions, would make the exec. smaller? Meaning that instead of have a DLL ( yes im on windows ), I would download the source code of a library and comment out the functions ( and code ) that I am not using -- Would this process decrease the size of my exec.?

View 2 Replies View Related

C++ :: Compile A Library In Windows?

Mar 7, 2013

I have download the SOIL library [URL] for loading textures in OpenGL, however it doesn't come with a SOIL.lib file but a file called libSOIL.a and it says I need to compile it myself.

View 11 Replies View Related

C/C++ :: Windows Library To Take Screenshots Of All Open Applications?

Jan 25, 2014

I'm looking for a library which enables me to take screenshots of a all open applications, and store them as .bmp or .jpg .

I've tried to find something but so far no luck

I don't necessarily need code just a library with good understandable documentation (if such a thing exists). Also, is something like this possible for a beginner-intermediate c++ user? If not where should I start?

View 9 Replies View Related

C/C++ :: Object File Size Increases In Windows?

Apr 11, 2013

My sample.h is

#include <string>
namespace xxx
{
class abc

[Code]....

My Question is when i compile this code in Linux platform Using g++ compiler My sample.o's Size is 1Kb.. But when the same code is compiled in Windows platform using VC++ Compiler , My sample.o's size is 42Kb..to reduce the size in windows... Is there any proble with '#include <string>' in Windows platform.

View 3 Replies View Related

C++ :: Reducing The Time Complexity?

Jul 21, 2014

I have a very simple program the time complexity of the function that I used in this program is O(mn)because it has a nested loop, I really need to reduce the time complexity to O(n)

[code=c++]
#include <iostream.h>
#include<stdlib.h>
int *char_count( const char* DNA, const int *starts, const int *ends, char letter);
int main()

[Code].....

View 5 Replies View Related

C :: Method Or Process For Reducing Redundant Code In Nested Loops

Nov 8, 2014

Have an assignment due in a few weeks and I'm 99% happy with it My question is is there a method or process for reducing redundant code in nested loops. Ie my code compiles and runs as expected for a period of time and after a few goes it omits a part or prints an unexpected out ext so basically how to find when the redundancy occurs with out posting my code so I can learn for my self?

View 3 Replies View Related

C++ :: Shared Library Vs Static Library?

Jan 17, 2014

I've been reading about libraries; How to make them, how to use them, the different types of libraries, etc..

When using a shared library, does the program require that library to be installed on the computer after the program has been compiled into an .exe?

Ie.. if somebody downloaded a "Helloworld.exe" that I had compiled on my computer using a shared library (that wasn't part of a standard operating system), would they also need that shared library on their computer for the program to run without errors?

and for Static Libraries, when I compile a program using a static library, does it include in the final binary only the functions of the library that are actually used, or does the compiler add in the entire library?

View 8 Replies View Related

Visual C++ :: Change Frame Window Size According To Increase In Font Size

Nov 27, 2012

Change the frame window size according to font size increases.

View 3 Replies View Related

Visual C++ :: Text Size In Screen Is Different From Size In Print Preview?

Feb 1, 2013

I must take an old MFC project in VC++ 6.0 and make changes.

The problem is text size in screen is different from size in print preview.

for example with this font

Code:
CFont f50;
f50.CreateFont(100,0,0,0,FW_BOLD,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FF_DONTCARE,"Frutiger LT Std 45 Light");

And this text

Code:
s=_T("Let's try to calculate the size of this text");

and with MM_LOMETRIC map mode

GetTextExtent() returns me:

On screen: (1595,99)
Ink printer + print preview: (1589,100)
PDFCreator + print preview: (1580,100)

comparing with screen size the height is bigger but lenght is smaller. I don't understand.

I can understand that different printers process the fonts in different way and then to have different lenghts. That's not the problem. The problem is I need to simulate in screen the same behaviour i will have on printer because these texts are being aligned in the document, and I don't want to see that the text si aligned different in text than in paper.

What can I do to render the text on screen with the same size I will have on the printer? Print preview is doing it. Should I change the font parameters? is something related with pixels per inch?

View 4 Replies View Related

C++ :: Reducing Code Duplication From Common Code Calling Common Class

Apr 13, 2014

I have a class 'A' which is almost perfect for my needs. Class 'B' uses class 'A' I've now designed Class 'C' and Class 'D' and noticed that there is a good chunk of code in class 'B', 'C' and 'D' for using Class 'A' is duplicated. I've separated out this code in specific, standalone functions in each of the classes. Now I'm wondering where this code should go. At the moment, the functions are duplicated in the three calling classes (B, C and D). Placing the functions into class 'A' would break the single responsibility principle. Inheritance to add functionality would likely break both SRP and LSP. The one that seems that it may work is composition.

However, Is designing a complete class just for a few functions over kill?

Would it be valid for classes 'B', 'C' and 'D' to access both the new class 'E' (which would depend on A) and the old class 'A' (which would have to be the same instance as the instance in the new class 'E'), or should the new class 'E' provide sufficient functionality so that Classes B, C and D don't need to access Class A directly? It would seem that its then an incomplete interface of the original object with additional functionality (ie, incompatible) Or should I do it a completely different way?

View 4 Replies View Related

C :: Why Size Of Struct Is Larger Than Sum Of All Size Of Its Members

Jul 11, 2013

I was wondering why, in C, the sizeof of a struct is larger than the the sum of all the sizeofs of it's members. It only seems to be by a few bytes, but as a bit of a perfectionist I fine this a bit annoying.

View 1 Replies View Related

C :: How To Install GMP Library

Feb 19, 2013

How do you install the gmp library.How do you use it?

View 11 Replies View Related

C++ :: GMP Library Memory

May 11, 2013

I'm trying out the gmp library by building a simple pi calculation program (original, I know!). On a million digits of Pi I've debugged the program and seem to have about a megabyte too much of memory at the end of the program (I start with around 250k before any allocation begins and end at around 1200).

int main(int argc, char *argv[]) {
//set a//
int digitsofpi =1000000;
mpf_set_default_prec(log2(10) *digitsofpi );

mpf_t a;
mpf_init (a);
mpf_set_ui (a,1);

[code].....

View 2 Replies View Related

C++ :: How To Set Bullet Library To GCC

Jul 11, 2013

I would like to set the bullet library to GCC. I downloaded source code of bullet but i don't know how to set that.

View 6 Replies View Related

C++ :: Using A Library Function?

May 9, 2013

I have been trying to find a way around the following:

I am using a library functor to solve the root of a non linear equation. It passes two doubles and the name of a function that contains the equation to be solved.

Its xtor and operator are

RootFind(double tL,double tR,double (*fn)(double t));

void operator()(double tL,doubleR,double (*fn)(double t));

I want to be able to send another variable to function fn; I don't know what the value of the variable will be ahead of time.

How do I get the library functor to take an extra variable in the function passed?

View 1 Replies View Related

C++ :: How To Use Library Opensteer

Nov 5, 2014

I use the library opensteer, but I do not know where you should start.

Opensteer is a library written in C ++. My problem is figuring out whether to create a blank project in visual studio and import the library or directly import the library.

View 2 Replies View Related

C++ :: UDP Socket Library On Linux

Jan 29, 2014

I'm attempting to write a little UDP socket library in c++ on linux so a user can just create a new instance of a UDPSocket class, specify destination ip and port, and just connect. Then the user should be able to call send() or receive() in any order they want.. and here I encounter a little problem..

Most of the tutorials for udp socket sending out there include a bind() call when you create your "server" that is supposed to receive data, but the code that send data does not need one. Because I also want my library to support unicast/broadcast/multicast, I have read that I need to set the socket option SO_REUSEADDR on my sockets (since multiple sockets will need to be connected to same destination IP/port for broadcast/multicast)

My question is.. do I need to create 2 socket handles per "UDPSocke in order to make this work? One for sending and one for receiving data? In my code when I try to work with only 1 socket, it is only able to receive stuff from itself on unicast.. Or should I just remove the SO_REUSEADDR when in unicast mode, then try to bind with both sockets, accept that the bind will only work on the 1st socket, and take it from there?

View 1 Replies View Related

C :: Graphic Library For Plots (2D And 3D)

Dec 28, 2014

Any common and good library for plots ? (2D and 3D)

View 1 Replies View Related

C :: Creating A Library Function

Jan 27, 2015

I want to create a C library function that i can directly call in my code from any .c file having main program.following are codes...code of library function "foo.c"

Code:

#include "foo.h"
int foo(int x) /* Function definition */ {
return x + 5;
} header file "foo.h"

Code:

#ifndef FOO_H_ /* Include guard */
#define FOO_H_
int foo(int x); /* An example function declaration */
}

[code]....

to use this i have to compile the file in below manner...

Code: gcc -o my_app main.c foo.c

My concern here is that i want to compile the main.c and use function without compiling foo.c with i.e.

Code: gcc -o my_app main.c

any user of this function should only compile his program and should be able to use the function, the foo.c file should remain hidden from him

my system is Linux 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux

View 9 Replies View Related

C :: Static Library Linking

Oct 7, 2014

I am trying to refresh my memory here as I did some studies many years ago but the results elude me.Also todays c/c++ compilers may have better optimizations.Say I have a static library that includes three obj modules.Each of these object modules has a number of functions. These functions do not reference any other functions within the obj module.My main app links this library but only references one function from each of the object modules.

Question: Are the complete contents of each module linked into my main app or are todays linkers smart enough to just link the functions used?

View 4 Replies View Related

C :: Library For Loading Images In PNG?

Jan 29, 2015

What's the best performance library for loading images in PNG?

View 5 Replies View Related

C :: Using PlPlot Library In Code

Mar 8, 2013

I am in try to use PlPlot library (for plotting) in C with code::blocks IDE (ver 10.05) on windows-7 plateform. I downloaded "plplot-5.9.9.tar" and unzipped it. In documentation it is not very clear to me (I am not expert in using third party lib.), how this library can be used with code::blocks i.e. where I have to save the lib, what should be added in compiler and debugger settings etc. It also seems from document that "makefile" (linux type!!) is necessary for Windows also? I am also unaware of MSYS makefile generator (given on Wiki page) on windows?

View 2 Replies View Related

C :: How To Create A Library Using Xcode

Feb 2, 2013

I'm completely new to C, and I don't know how to create a library using Xcode.

View 5 Replies View Related

C++ :: Allegro5 Library Compilation

Feb 5, 2015

I have a problem with compiling the Allegro5 library:

"Cannot find allegro-5.0.10- monolith.mt"

source:

#include <allegro5/allegro.h>
#include <allegro5/allegro_primitives.h>
#include <cmath>
int main() {
al_init();
al_init_primitives_addon();
al_install_keyboard();
ALLEGRO_KEYBOARD_STATE klawiatura;

[Code] ....

View 1 Replies View Related

C++ :: List Library - How To Traverse Through A And B

Aug 22, 2013

I'm trying to make a list that contains other lists. I want to use the <list> library /not my own implementation/. Here is what I do:

list<list<int>> Lists; //I create the main list
list<int> A, B; //Then I create the other lists
//After I fill them with data I add them to the main list
Lists.push_back(A);
Lists.push_back(B);

The problem comes when I try to go through A and B. I make an iterator of the main list:

list<list<int>> Iter = Lists.begin();

Then I need to make an iterator to traverse through A and B. But I can't make it. I do this:

list<int> Iter2 = Iter.begin() //But the compiler says it is not possible

How can I traverse through A and B?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved