Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6907723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:28:15+00:00 2026-05-27T08:28:15+00:00

I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It’s

  • 0

I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It’s basically a distance scanner driver. The program I’m trying to run is in sicktoolbox-1.0.1/c++/examples/lms/lms_plot_values in case you wanted to see the code I’m talking about.

Anyways, the lms_plot_values project folder contains gnuplot_i.cc, gnuplot_i.hpp, main.cc, Makefile, Makefile.am, Makefile.in. So I put the first three files in my Eclipse Indigo CDT, compile (no compiler errors, everything’s correctly linked in Eclipse already and all needed libraries are added), but this sample program is written to take in command line arguments. Here is as far as the code gets.

/*!
 * \file main.cc
 * \brief Illustrates how to acquire a measurements from the Sick
 *        LMS 2xx using the configured measuring mode.
 *
 * Note: This example should work for all Sick LMS 2xx models.
 *
 * Code by Jason C. Derenick and Thomas H. Miller.
 * Contact derenick(at)lehigh(dot)edu
 *
 * The Sick LIDAR Matlab/C++ Toolbox
 * Copyright (c) 2008, Jason C. Derenick and Thomas H. Miller
 * All rights reserved.
 *
 * This software is released under a BSD Open-Source License.
 * See http://sicktoolbox.sourceforge.net
 */

/* Implementation dependencies */
#include <stdlib.h>
#include <string>
#include <vector>
#include <signal.h>
#include <iostream>
#include <sicklms-1.0/SickLMS.hh>
#include "gnuplot_i.hpp"

using namespace std;
using namespace SickToolbox;

bool running = true;
void sigintHandler(int signal);

int main(int argc, char * argv[]) {

  string device_str; // Device path of the Sick LMS 2xx
  SickLMS::sick_lms_baud_t desired_baud = SickLMS::SICK_BAUD_38400;

  /* Check for a device path.  If it's not present, print a usage statement. */
  if ((argc != 2 && argc != 3) || (argc == 2 && strcasecmp(argv[1],"--help") == 0)) {
    cout << "Usage: lms_plot_values PATH [BAUD RATE]" << endl
     << "Ex: lms_plot_values /dev/ttyUSB0 9600" << endl;
    return -1;
  }

As it says, it throws an error and kills the program, saying it wants me to type “lms_plot_values /dev/ttyUSB0 9600” from the command line to run the program, but I can’t do that, and I’m wanting to do everything in eclipse so I don’t want to do that. I tried adding:

argv[1] = "/dev/ttyUSB0";
argv[2] = "9600";

But that didn’t work because of the argc checks. Do you know if it says to pass in “lms_plot_values /dev/ttyUSB0 9600”, why it would be expecting or where it would be getting the argc values from? Or how I can make it think these parameters were passed in? I’m not very familiar with how C++ works like this, I’ve only used Java.

Thanks for any help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:28:15+00:00Added an answer on May 27, 2026 at 8:28 am

    You can pass arguments in eclipse too. Once you build your project, try creating a run configuration and there you can pass the arguments. Here is the screen shot:

    enter image description here

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the example code, I'm using these functions for a program, but scanf
i'm using this example implementation found at http://tangentsoft.net/wskfaq/examples/basics/select-server.html This is doing most of what
I am using the example from TheElements sample code provided with the iPhone SDK
I am trying to use R2WinBUGS using this example: code (Please only consider the
Using the example code included in the man page for DateTime::Astro::Sunrise , I'm getting
I am new to development. I followed step by step instructions from http://code.google.com/apis/maps/articles/flashmapinwpf.html to
I'm trying to interface with the Google Reader (undocumented/unofficial) API using information from this
So I have this program that fetches a page using a short link (I
So I have this program that fetches a page using a short link (I
I am trying to write a C++ program to read from a website using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.