C++ :: Check Orientation Of Polygon With Boost Library?

Jun 24, 2013

Is there any way to check the orientation of polygon with boost library? If so, any small example?

View 1 Replies


ADVERTISEMENT

C++ :: Static Linking Boost Library

Dec 17, 2014

I have written a program that uses boost in visual studio 2012. The only boost library I used is filesystem by doing.

1)Properties->Linker->General and adding the path or the .lib to the additional dependencies. The libraries, link at compile time.However when i move the exe to a different computer, it doesn't work. Therefore the libraries were dynamically not statically linked. So my question is how do I statically link the filesystem library, so that i can include boost/filesystem.hpp in visual studio 2012?

View 1 Replies View Related

C++ :: Library (Eigen / Boost) To Calculate Principle Component Analysis (PCA)?

Mar 4, 2013

I have a text file which consists of 907 objects and 1000 feature vector for each object. Is there any Library (Eigen/Boost) to calculate Principle Component Analysis(PCA)?

View 1 Replies View Related

C++ :: Write Program That Uses Boost Library To Input String Date?

Apr 23, 2014

I'm trying to write a program that uses the Boost library to input a string date in the format mm/dd/year and outputs to the string its corresponding day of the week. I wrote the program that I thought would accomplish this, but it doesn't seem to work. Below is the code I wrote:

#include <string>
#include <iostream>
#include "boost/date_time/gregorian/gregorian.hpp"

[Code]....

When I compile this using codeblocks it gives me the error "In function `ZN5boost9date_time19month_str_to_ushortINS_9gregorian10greg_monthEEEtRKSs':|
C:Users
osaDesktop est3........Liboost_1_55_0oostdate_timedate_parsing.hpp|67|undefined reference to `boost::gregorian::greg_month::get_month_map_ptr()'". And it takes me to the file date_parsing.hpp and highlights line 67. I don't understand why this isn't working.

View 3 Replies View Related

C++ :: How To Get Standalone Copy Of Regex Part Of Boost Library To Work In Project

Feb 18, 2012

So, I have spent the last week looking googling and researching how to get a standalone copy of the regex part of the boost library to work in a project. This project will be compiled on other machines and I CANNOT have the user install it.

Is there any way to do this?

So far, I have built the regex part: I have both .so files and .a files built. The thing that I'm unsure of is that these were built with gcc and I am using/will be using g++.

I have also finally got the bcp tool to work, and extracted the regex part and all of its dependencies.

I can't get it to compile any way I try to work it. I need this to be in a folder "regex/" folder in my directory.

I have used too many commands to paste them all, but the last I tried was this:

g++ -g -pedantic -Wall -o doit test.C -Iregex/boost/ -Wl,-Lregex/libs/regex/build/gcc/ -static -lboost_regex-gcc-1_47

I have also tried many variations of the above command. Such as using -lboost_regex and lots of other things. Is my whole problem because I'm using an .so built by GCC?

The output of the above command was

/usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
(.text.__cxa_allocate_exception+0xb4): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_allocate_exception':
(.text.__cxa_allocate_exception+0x111): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i686-linux-gnu/4.6.1/libstdc++.a(eh_alloc.o): In function `__cxa_free_exception':

[Code]...

View 4 Replies View Related

C :: How To Emulate Object Orientation With Multiple Files And Make File

Feb 13, 2013

how to structure my classes so that they all "wire together" and inherit the proper functions and data that I want them to. I want to have a Car.c and car.h which are "wired" with body.c/body.h, which in turn is wired with a frame.c/frame.h, wheel.c/wheel.h, and driver.c/driver.h.

Each part of the car holds some type of data, mostly ints: The car has a (total) mass and car_name. The body has a mass and color. The frame has a mass. The wheel(s) have a mass and force. [There will be 4 instances of wheel] The driver has a mass and driver_name. Each of these functionalities must come from their respective .c and .h files, and be amalgamated in the car.c and car.h (which should contain all the functionality of its parts). Then, in my main test program, I am to make an instance of car and hardcode in its values of: mass (which comes from the total mass of all of its parts, this is where i start to lose it.

How will I access its parts' masses in the test program?), color (a character array), current position (an integer), current velocity (an integer), and current acceleration (which comes from the total newton force of the 4 wheels, again this is where I start to get very confused). (Then in the test program I am to print out a simulation of this car over a period of 100 seconds, and show its position, velocity, and acceleration at each point (based on the mass, total newton force, and starting position). This part is of course a simple while loop, and is somewhat trivial.)

From what I understand, I will need to allocate memory for all of the data each class holds. Then, using function pointers, as well as #include "X.h" , I will need to somehow link up all of the classes together so that car has access to all of the parts' functions which set, for example, the newton force of each wheel.

We have learned a slight bit about structs, malloc, sizeof, and pointers, but I have not used them to link functionality or data from separate classes together.

View 4 Replies View Related

C++ :: How To Draw A Polygon

Nov 16, 2013

I am fairly new to c++, and I want to be able to draw a polygon. When I have searched for how to draw one, the only thing i can find is scripts doing things like this:

*
**
***
****
*****

I doubt that c++ is that primitive, and I'm looking for something like the c++ equivalent of this python script:

Syntax: draw.polygon((20,20)(30,30)(50,30)(20,40)(20,20), fill(green))

I am using a mac os 10.9

View 2 Replies View Related

C/C++ :: How To Move Object (Polygon / Triangle)

Feb 13, 2013

i draw some object (polygon , triangle , etc.. ) and i want to move them from side to side automatically and from keyboard ...

View 1 Replies View Related

C/C++ :: Finding Whether Point Is Inside Polygon

Jul 17, 2012

I am trying to find out whether a point is inside a polygon.I am using vector std c++.

My program till now:

Polygon.h
class Polygon {
public:
Polygon();
virtual ~Polygon();
virtual bool Inside(Point p);

[Code] ....

I liked the ray casting algorithm but I dont know how to do in C++.

View 28 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

C++ :: How To Boost Up Execution

Feb 23, 2013

I wrote a program to run long simulations, in one cpu core computation. During the run, I checked the cpu occupation was always around 85%.

Since my simulation took time to run. How can I boost it up to make my cpu run at 100%? Is that because my RAM is not fast enough?

info about my laptop: cpu frequency: up to 3.2 GHz. RAM frequency: 1333 MHz.

View 2 Replies View Related

C++ :: Passing A Reference Of Arg (boost Lib)

Dec 19, 2013

I have in my main(), a function that creates my arg object using boost/program_options.hpp i want to pass this object to another function using templates like this:

Code:
template <typename Targ>
void Count(Targ & arg){
MyObj<string> QueryTab(arg["input-file"].as<string>()); //line number is 352
...
}

However I get an error:

Code:
../include/Filter.hpp: In member function ‘void Count(Targ&)’:
../include/Filter.hpp:352:40: error: expected primary-expression before ‘>’ token
../include/Filter.hpp:352:42: error: expected primary-expression before ‘)’ token
... obviously it does not recognize my intention, what did I do wrong?

View 2 Replies View Related

C++ :: How To Get Boost Libraries To Work With QT IDE

Mar 5, 2013

I have an issue getting boost libraries to work with QT IDE. Here are relevant lines from my .pro file...

INCLUDEPATH += c:/users/bob/desktop/boost_1_53_0/
LIBS += -LC:c:/users/bob/desktop/boost_1_53_0/stage/lib64

After adding #include <boost/filesystem.hpp> I get error...

C:UsersobDesktopqtpuntitled5mainwindow.cpp:3: error: C1083: Cannot open include file: 'boost/filesystem.hpp': No such file or directory

The IDE does not highlight the line. The error only appears on compilation.

View 2 Replies View Related

C++ :: Boost Filesystem Exception

Mar 12, 2014

I have one problem deleting a file with boost. The file is opened in another application and cannot be deleted. I am supposed to received an exception error but I don't get it.

Here is my piece of code, very simple:

bool delete_file(const string &path) {
boost::filesystem::path bpath(path);
try {
if (boost::filesystem::remove(bath)) return true;

[Code] ....

I have put a breakpoint inside the catch part but it does not come to this point. Instead, the the output window of visual studio, I got these lines:

First-chance exception at 0x00007FFD2E575A88 in site_server.exe: Microsoft C++ exception: boost::filesystem::filesystem_error at memory location 0x00000070F8E3E920.
Unhandled exception at at 0x00007FFD2E575A88 in site_server.exe: Microsoft C++ exception: boost::filesystem::filesystem_error at memory location 0x00000070F8E3E920.

How to manage this situation?

View 1 Replies View Related

Visual C++ :: Boost Is Not A Namespace

Nov 29, 2013

exportmain.cpp

Code:
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
// Create an empty property tree object
using boost::property_tree::ptree;
#include "kwxport.h"
#include "resource.h"

[Code] ....

How can I make boost:roperty_tree:tree get recognized by the compiler?

View 2 Replies View Related

Visual C++ :: How To Add Boost Libraries

Oct 1, 2013

i have written an algorithm in VC++ 2010 express edition. i have used the following header files

#include<iostream>
#include<string>
#include<sstream>
#include<ctime>
#include<cassert>
#include<fstream>
#include<vector>

[Code]...

the algorithm worked fine in vc 2010 express edition....

the following header files are not working in vc5

#include<regex>
#include<tuple>
#include<numeric>
#include<unordered_set>
#include "clip.h"

Looks like some of hte boost libraries have to added with vc5.. If any one knows how to add boost libraries with vc5.

showing lot of errors in vc5... not able to run the algorithm in vc5. Our company has only vc5.... the algorithm has to be implemented in vc 2010....

View 2 Replies View Related

C++ :: How To Read Tag Name Of Boost Ptree

Mar 23, 2014

[URL] ....

I wonder how tag reading can be achieved? If say I have a file like

<name>
<firstname>John</firstname>
<surname>Robinson</surname>
</name>

I'd like to read "firstname" or "surname" instead of John or Robinson ....

View 4 Replies View Related

C++ :: Use Boost / Regex For Regular Expressions?

Sep 5, 2013

So I need to use boost/regex for regular expressions. someone told me that it needs to be built. the first problem is boost doesn't tell you how to build it and the second is i did sudo apt-get install libboost something. I don't remember the exact name of the package. it installed but i dont know how i would build it when its installed.

View 2 Replies View Related

C++ :: Error Handling When Using Boost NonCopyable

Aug 2, 2014

I have been using a Boost NonCopyable library in Microsoft Visual Studio 2013.

What I have is the following error message:

Error1error C2280: 'boost::noncopyable_::noncopyable::noncopyable(const boost::noncopyable_::noncopyable &)' : attempting to reference a deleted functionc:usersjohndocumentsvisual studio 2013projectsdonttreaddonttreaddonttread.cpp181DontTread

Now what I want to rectify the error is to throw an exception, so that the program can compile smoothly.

View 4 Replies View Related

C++ :: Boost Memory Mapped Object

Aug 21, 2014

i've created dll and implemented shared memory that every connected process can use. My problem is that i can't change anything in object, which is stored in the memory.

my class :

class MyClass
{
public:
MyClass();
void test();
int counter;
};
void MyClass::test() {
MessageBoxA(NULL, "test", "test", 0x0000000L);
counter++;
}

in stdafx.h i have :

static offset_ptr<MyClass> offset_mt;
static managed_shared_memory *memSegment;

I initialize shared memory and pointer :

memSegment = new managed_shared_memory(create_only, SHARED_MEMORY_NAME, 4096);
offset_mt = memSegment->construct<MyClass>("MyClass myClass")();

And then in an exported function i call

offset_mt.get()->test();

Im calling this from Java using JNA and result is a memory error (Invalid memory access). However, if I delete 'counter++' from test method, everything works fine - message box appears. Is there a limitation that I cant modify objects inside mapped memory or is this done the other way?

View 3 Replies View Related

C/C++ :: How To Assign Pointers For Boost Matrix

Aug 4, 2014

I am using boost matrix for generating matrices used for filters. I wan to assign a pointer to these matrices so i can call them out of the function. but i am not able to understand where i am failing. the example code is here.

int main(int argc, char *argv[]) {
QApplication a(argc, argv);
identity_matrix<double> M(3);
std::cout<<M<<std::endl;

[Code] ....

View 9 Replies View Related

C/C++ :: Linking Boost Thread With Xcode

Sep 30, 2014

I have built Boost from the website using

./bootstrap.sh
./b2 install

I think all are installed properly. I am trying to use Xcode to include the library of boost:thread.My code links to the header file properly with " #include "boost/thread.hpp"" commented, as seen from the following:

However, it could not link properly to boost-thread if "#include "boost/thread.hpp"" is un-commented.

Error page is shown as:

I have linked the dynamic library libboost_thread.a and libboost_thread.dylib and included /usr/local/include into header search path and /usr/local/lib into library search path.

View 1 Replies View Related

C++ :: Listing Files With Boost Filesystem

Jun 7, 2013

I have the following code which is based of the tut3.cpp example at: [URL] ....

However, I'm not entirely sure how to retrieve the full file path which I'd like to use to get the file size. So essentially the aim is to go through a directory and list all the file sizes.

Code:
if (exists(p)) {
if (is_directory(p)) {
cout << p << " is a directory containing:
";
copy(directory_iterator(p), directory_iterator(), // directory_iterator::value_type

[Code] ....

View 1 Replies View Related

C++ :: Mesh Array Of Double Boost

Jul 11, 2012

I wanna create mesh Array using boost elements, that will be do the same that code below, but can accept numbers of double. Any boost array that give me needed functionality. It will be great that advised element has the same argument list. I mean

// [base,stride,bound)
// [0,2,4)

Or may be there are any opportunity modify this boost::multi_array_types::index_range in order do make it accept double...

1>------ Build started: Project: HP_A.1_d_, Configuration: Debug Win32 ------
1> Main.cpp
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(15): warning C4244: 'argument' : conversion from 'double' to '__w64 int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(15): warning C4244: 'argument' : conversion from 'double' to '__w64 int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(18): warning C4244: 'argument' : conversion from 'double' to 'unsigned int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(20): warning C4244: 'argument' : conversion from 'double' to 'unsigned int', possible loss of data
1>c:all myс++ha level 9solutionlevel 9hp_a.1_d_main.cpp(20): warning C4244: 'argument' : conversion from 'double' to 'unsigned int', possible loss of data
1> HP_A.1_d_.vcxproj -> C:all myс++HA level 9SolutionLevel 9DebugHP_A.1_d_.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Code:
#include <boostmulti_array.hpp>
#include <iostream>
typedef boost::multi_array_types::index_range range;

[Code]....

View 1 Replies View Related

C++ :: Accessing Array In A Thread (boost)

Nov 22, 2012

I was wondering if it was possible to access data from an array inside a threaded function after it has finished executing?

Take this example:

Code:
#include <iostream>
#include <boost/thread.hpp>
using namespace std;

[Code]....

After workerFunc has finished, how could I access the array arr? Is there any way to get (3,4,5,6,7) back into main()?

View 5 Replies View Related

C++ :: Unable To Get Random Numbers Using Boost In A Class

Apr 24, 2014

I have been working with and trying to understand Boost for random number generating. I've come to understand that what I want is now in the C++11 standard, but I've stuck with Boost.

What I have done is create a simple main.cpp that generated random numbers successfully. From there I wanted to create a more optimal system by separating out the random code portion to a class that can be instantiated and called on demand. My problem now is that when I call the random routine of the class I just get one number no matter how many times it's called.

I know that rapid seeding is an issue so I put the seed function of the random portion in the class's constructer so that it is only called once on the creation of a class. I also tried making it a static member, but I haven't had success with that yet either. For now though, I would simply like to get successive random values upon calling the class's random function.

class header Code: #ifndef roomGen_hpp_
#define roomGen_hpp_
#include"boost/random.hpp"
#include"main.hpp"
class
roomGen
{
private:
boost::mt19937rngDimensions;

[code].....

The main.hpp file only contains a couple of struct definitions. In main I call the class with Code: randomRooms.push_back(randRooms.createRoom()); to get back a struct with random values and push it into a vector.

I'm unsure what I'm doing wrong here to only get back a single non random number from successive calls. I have tried moving the variable creation lines from roomGen::createRoom() to the private area of the class definition, but that causes me to get a slew of undefined errors so I had to settle on putting those declarations inside the function.

View 4 Replies View Related







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