C++ :: How To Exchange Big Structures Across Libraries
Nov 6, 2014
I have written library in c++ for c++ application. Here, data exchange between library and client through structure. This structure has 20 members ( strings, integers, reals, pointers).
In some flows, library needs few members should get filled in the structure. for ex, application filled 3 integers information and passed to structure. But, in memory, whole structure is occupied.
I think, If library provides functions for every combination, then it would end up with lot of functions. I want to avoid that.
How to optimize data exchange between client and library? ( number of members may be filled sometimes 1, 2, 3, .. 20)
I am trying to iterate a matrix in order to exchange rows and columns element by element. Although the function that exchanges the rows has come out well, i don't seem to figure out how to do the same on columns.The columns switch for a matrix like
I'd like to use the Big Integer Library [URL], but I have issues to use it. I'm using Xcode as compiler and I don't know how to include the library in my project files. When I drag all the files in the project directory and write the statement #include <BigInteger.hh> on the top of the declaration of the main function, even whiteout any other code, I get lots of build error on the .hh and .cc file.
Is there any way to do date math using standard C libraries? I looked around in the time.h but didn't see what I needed.
What I need to do is be able to add a certain number of minutes to a date and have it give the current date/time. For example, add 15918765 minutes to 01/01/1980 00:00 and have it tell me 04/07/2010 4:45PM. I really don't want to write this myself or go platform-specific.
I know I can use -isystem path to mark a path as containing system headers which shouldn't be included when generating warnings, and this works, but it doesn't work when the warnings are generated by instantiating templates from the library in my source code. Is there any way to ignore these template-instantiation-generated warnings too?
I'm trying to create a GUI with Open graphics Libraries.I have made a basic GUI that exits the program or shows the instructions if a option/Polygon is marked (A bigger one is behind them)But what I'm trying to do now is the following:
0. Start the direct access on the desktop 1. Screen: Press any key to continue 2. Select one option 2.1 Option one: Go to the circuit selection menu 2.1 Option two: View the instructions (Cleared) 2.1 Option three: Exit the game (Cleared) 3. Select a circuit 4. Go to the car selection menu 5. Select a car and start the race 6. Pause menu if Spacebar has been pressed
From the pause menu:
6.1. Go to the main menu 6.2. Restart the race 6.3. Exit
I know that it is OpenGL, but what i'm looking for is C++.How I could do that? What I have cleared is with IF but I'm looking for better alternatives.
There are many libraries in C++, but how are they made?
For example: SDL, SFML, Open CV, STK
There are no special functions in C++ from which we can create such libraries, If I wanted to create a library that processes sound signals, how would I do that? How can I access the mic, speakers and process the signals.
Open CV processes videos but which functions does it use?
I want to write a small game library that uses GLFW.
So I have for example a window class that uses GLFW functions.
To do that my window class must include the GLFW header files.But I don't want, that if I use my library later and I include my window class, that all GLFW functions are included, too.
How I can prevent this and hide GLFW from users of this library completely, so they theoretical don't notice that this library use GLFW ?
And a second question, is it possible, if I export my game library statically that the GLFW lib files are hidden in my own lib files, so that I have finally only one lib file that is needed to use my library ?
I've worked a lot in Java and Perl and now I'm learning C++ and working on a simple e-reader (let's not get into why I'm not just using Kindle or other existing ones). This is for me and a number of friends.
At first my project will be on OS X, then Windows and Linux, and I hope to eventually use it on Android and iOS. I know that the last two will require separate GUIs, but I'm hoping the rest of the code will port easily.
Here's the problem:
I'm using Poppler to read and display PDF files. I started installing it on my iMac and it needs FontConfig, which is turning out to be a difficult install. I would not want to walk others through this or make them have to install Poppler and FontConfig (and any other libraries I find both need).
I thought I could just compile my final binaries using "-static" but I've been reading about how some libraries can't be statically linked or compiled.
Also, since I want to eventually port this to 4 other OSes (and apparently Poppler can work on those target OSes), I don't want to do something now or depend on something that will make it hard or impossible to port to other OSes later.
With that in mind, here are my questions:
1) Why is it some libraries cannot be compiled statically? How do I know if I'm dealing with one of those libraries?
2) Am I right that I could compile this program statically, and the resulting binary would include code from Poppler and FontConfig and other libraries would be included in the resulting executable binary?
3) What do I need to watch for so I can tell if using a particular library will be a problem when I need to port my program to a new OS? (Assuming, of course, that searching shows that library will compile or has been ported to that OS.)
I have been trying to compile a static version of the boost libraries, however when I try to launch the program it says fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-s-1_53.lib'
I have checked in the boost/stage/lib folder and that file is not there. I compiled boost with b2 link=static yet the file still isn't there.
The brief is to write a program that implements a musically-interesting or musically-useful audio effect/process in C without external libraries other than those prescribed (PortMedia/PortMIDI/PortSMF/PortAudio, Libsndfile).
I've finished my series of tutorials and built a investment calculator with QT, now that's finished and I wanted to create a small radio that allows to retrieve audio from an URL. I wanted to use Juce but I'm clueless about it, I know how to program but I've never touched external libraries?
I'm currently working on a Microsoft (unmanaged) C++ project which utilizes Boost C++ libraries. It's been quite a while since I've done C++ and I have no previous experience using the Boost libraries.
We are using Boost 1.55 and MSVC 2013. We used CMake to generate the Visual Studio solutions and projects based on the original project layout.
We've successfully built and tested on other environments. In the MSVC - Windows environment, we've run into issues using Boost's Property Tree support. Specifically, the issue seem to center around trying to put properties into PTNodes.
This work around seems insert the nodes successfully into the tree.
We are able to verify by finding the inserted items in ::SetResult().
Why this might be failing in VisualStudio C++?
Is this an issue of compiler flags?
precompiler definitions?
Linker options??
Memory mode/model??
Are there some basic behaviour differences in MSVC C++ and other C++ environments which we are unaware of?
I've tried to identify all instances of the node insert pattern and use the work around. But, we really need to find out what the issue is (as there could be other manifestations).
Ok, for my Sunday homework I have to find the next day of the year using structures. Now, I can get the structure to read the entered date (tested that with a simple scanf to printf entered data), but I need to get it to be able to tell that it is the end of the month and print out the next month when necessary. Here is what I got so far:
Code: //Cameron Taylor #include <stdio.h> struct Date{ int month; int day; int year;
[Code] ....
As you can see, I am trying to use an array for the max day of each month (excluding Leap Year for now).
Where I use the entered month to = 'i'. Then I use 'i' as the position in the array to see if next.day is = to the max day of that position of the array.
I am having no compiler issues with GCC using -w or -Wall, but after entering the current day the program stops working and doesn't go beyond the input.
commiedic@localhost Project18$ gcc -o -Wall Exercise4.c commiedic@localhost Project18$ gcc -o -w Exercise4.c commiedic@localhost Project18$ gcc -w Exercise4.c commiedic@localhost Project18$ make Exercise4 make: `Exercise4' is up to date.
A user is supposed to enter student name, id, and grade then sort them by name, id, or grade. I managed to get it to sort by name and id correctly, but not by grade.
How do I store pointers to a struct in an array ? I am using sprintf to concatenate some values together and then output it to an array in its 1st argument. A portion of my code is shown below.