473,856 Members | 1,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error running my project

Hi

I need help in finding out why the error below, I am writing a through
away program in C++ using debian/testing machine.

thanks

*************** * error *************** *
fred@debian:~/myPrograms/common$ make clean; make; ./proj
rm -rf *.o proj
g++ -Wall -g -c -o read_data.o read_data.cpp
g++ -Wall -g -c -o read_data_test. o read_data_test. cpp
g++ -g -o proj read_data.o read_data_test. o -lgsl -lgslcblas -lm
gsl: fprintf_source. c:164: ERROR: fscanf failed
Default GSL error handler invoked.
Aborted
fred@debian:~/myPrograms/common$
*************** * read_data.h *************** *
#ifndef READ_DATA_H
#define READ_DATA_H
#include <string>
#include <cstdio>
#include <gsl/gsl_matrix.h>

class read_data
{
int nRows, nCol;
std::string file_name;
void set_No_of_Rows_ Cols();
gsl_matrix * m; // from gsl_matrix.h
void matrix_the_file ();

public:
read_data(std:: string const& fileName);
~read_data();

};
#endif

*************** * read_data.cpp *************** *
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <gsl/gsl_matrix.h>
#include "read_data. h"

using namespace std;

read_data::read _data( string const& fileName )
: file_name( fileName ){
nCol = 0;
nRows = 1;
set_No_of_Rows_ Cols();
matrix_the_file ();
}
void read_data::set_ No_of_Rows_Cols () {
ifstream in(file_name.c_ str());
string line;
getline(in, line);
stringstream input( line.c_str() );

string word;
while(input >word)
nCol++; // init'd by constructor

while (getline(in, line))
nRows++; // init'd by constructor
}
void read_data::matr ix_the_file(){
// allocate memory for the matrix
// needs to be freed later using
// void gsl_matrix_free (gsl_matrix * m)
m = gsl_matrix_allo c (nRows, nCol);
FILE * f = fopen(file_name .c_str(), "rb");
gsl_matrix_fsca nf (f, m);
fclose(f);
cout << "data read" << endl;
}
read_data::~rea d_data() {}

/*
std::string command = "wc -l";
std::system( ( command + " " + file_name ).c_str() );
}
*/

*************** * read_data_test. cpp *************** *
#include <fstream>
#include <iostream>
#include <string>
#include "read_data. h"

using namespace std;

int main() {
string f = "../../data/ZB/Jun06/20060405";
read_data data1( f ); // space delimited

}
Jul 23 '06 #1
1 2303
Gary Wessle wrote:
I need help in finding out why the error below, I am writing a through
away program in C++ using debian/testing machine.

thanks

*************** * error *************** *
fred@debian:~/myPrograms/common$ make clean; make; ./proj
rm -rf *.o proj
g++ -Wall -g -c -o read_data.o read_data.cpp
g++ -Wall -g -c -o read_data_test. o read_data_test. cpp
g++ -g -o proj read_data.o read_data_test. o -lgsl -lgslcblas -lm
gsl: fprintf_source. c:164: ERROR: fscanf failed
Default GSL error handler invoked.
Aborted
fred@debian:~/myPrograms/common$
*************** * read_data.h *************** *
#ifndef READ_DATA_H
#define READ_DATA_H
#include <string>
#include <cstdio>
#include <gsl/gsl_matrix.h>

class read_data
{
int nRows, nCol;
std::string file_name;
void set_No_of_Rows_ Cols();
gsl_matrix * m; // from gsl_matrix.h
void matrix_the_file ();

public:
read_data(std:: string const& fileName);
~read_data();

};
#endif

*************** * read_data.cpp *************** *
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <gsl/gsl_matrix.h>
#include "read_data. h"

using namespace std;

read_data::read _data( string const& fileName )
: file_name( fileName ){
nCol = 0;
nRows = 1;
set_No_of_Rows_ Cols();
matrix_the_file ();
}
void read_data::set_ No_of_Rows_Cols () {
ifstream in(file_name.c_ str());
string line;
getline(in, line);
stringstream input( line.c_str() );

string word;
while(input >word)
nCol++; // init'd by constructor

while (getline(in, line))
nRows++; // init'd by constructor
}
void read_data::matr ix_the_file(){
// allocate memory for the matrix
// needs to be freed later using
// void gsl_matrix_free (gsl_matrix * m)
m = gsl_matrix_allo c (nRows, nCol);
FILE * f = fopen(file_name .c_str(), "rb");
gsl_matrix_fsca nf (f, m);
fclose(f);
cout << "data read" << endl;
}
read_data::~rea d_data() {}

/*
std::string command = "wc -l";
std::system( ( command + " " + file_name ).c_str() );
}
*/

*************** * read_data_test. cpp *************** *
#include <fstream>
#include <iostream>
#include <string>
#include "read_data. h"

using namespace std;

int main() {
string f = "../../data/ZB/Jun06/20060405";
read_data data1( f ); // space delimited

}
You don't tell us which line generates the error, but I'll take a wild
guess that it's "gsl_matrix_fsc anf (f, m);". Since the GSL is off-topic
here, you'll want to read the documentation for it, consult any user
lists that the authors might maintain, or check out the code for that
function directly (it's open source). My guess is that there's
something wrong with the file you're trying to read in.

Cheers! --M

Jul 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4631
by: Bruce A. Julseth | last post by:
This is my 2nd request. Is the question too vague? Or, too difficult to answer. I'm really a newbie at this VS.NET stuff and do appreciate some help on this problem.---I keep getting the error "Unable to Start Debugging on the Web Server." I am on a standalone, non networked computer running XP Professonal and VS.net, and doing my development using VS.C#. I "think" I have gone through eveything listed in help for this error, but...
4
11151
by: Stephen Miller | last post by:
Hi, I am running v1.1.4322 on Win2K server and unable to debug a ASP.Net application running locally, using a full URL (ie www.mysite.com). When I hit F5, I get the following error message: <debugger_error_message> Error while trying to run project: Unable to start debugging on the web server. The project is not configured to be debugged.
2
1477
by: VB Programmer | last post by:
When I try to copy a project to our new web server I get this error: An Error occurred while copying the project '.....'. Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services. I went to run 'aspnet_regiis -i' on the server but 'aspnet_regiis' isn't on the server anywhere and furthermore I have no VS.NET 2003 command prompt. The...
4
3315
by: a | last post by:
When executing the ASP.NET app, I get: "Error while trying to run a project: Unable to start debugging on the web server. A debugger is already attached. Would you like to disable future attempts to debug ASP.NET pages for this projecty? Yes or No" There are no compile errors. If I answer "Yes", it turns off the debug option in one of my projects (data layer). If I answer "No", it returns to the IDE.
5
1597
by: Dave Y | last post by:
Hello, When I try to run my aspx web page using Start>Debug I receive the following error: "Error while trying to run project : Unable to start debugging on the web server. Would you like to disable future attempts to debug ASP.NET pages for this project?" I have found some KB Articles that provide a resolution to this issue but nothing seems to work; I continue to get the error. So far I have done the following: 1.Repaired the IIS...
2
2222
by: Jeff | last post by:
I'm getting an Object Reference error before I even run my app, and I'm not sure where to look to find the cause. I'd appreciate your help. When I open my Windows Application project, the following Microsoft Development Environment error message displays: "Object reference not set to an instance of an object." Then when I access the design view of one of my forms, the controls on
10
1541
by: JLuis Estrada | last post by:
Hi there Its my 1st post in this group and I hope we could have a great time. well, this is my problem I was debbuging my app (a website) and the system get stuck and I had to reboot the system. Since that day, everytime I tried to open the VS2003 and run my app, the system showed me a message like:
23
5148
by: deathtospam | last post by:
A day or two ago, I wrote a quick ASPX page with a CS codebehind using Visual Studio .NET 2005 -- it worked, I saved it and closed the project. Today, I came back to the project, reopened the solution, and was greeted with the following error: ======================================================================== It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error...
0
1395
by: sankohar | last post by:
I have two vb projects.I am calling second project from first project.In first project i have added a reference of activex exe of second project. Now when i am running the first project in debug mode, i am able to debug second project also and its working fine. But if i run the first project exe directly, i am getting VB Runtime Error -" 2147217887 Multiple-step OLE DB operation" from my second project. In debug mode its works fine but in...
7
8466
by: Norman Diamond | last post by:
A project depends on VC runtime from Visual Studio 2005 SP1, and DotNet Framework 2. Options are set in the setup project properties, so if these two dependencies are not already installed then this installer will install them. But what about the situation where VC runtime has already been installed? In fact it's been installed twice. Although the project was built on a Windows XP system with Visual Studio 2005 SP1 and the results were...
0
11061
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10699
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10787
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5762
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5960
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4578
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4176
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.