SE 2040 Notes on Using Command Line
Arguments in Eclipse
At times you need to specify
- Click on the project and select Run Configurations... from the Run
menu.
- Select C/C++ Application and click on
the icon to
create a new configuration.
- Click on the Arguments tab and enter the argument such as
myfile.xyz
- Rename the configuration to something like "use myfile" so that you
can keep it separate from other configurations.
- Select the Common tab and check the entries for Debug and Run in the
Display in favorites menu box.
- Select Apply and then close the configuration manager.
You can then select the new run configuration from the dropdowns next to
the debug and run icons .
Other Fixes
- Eclipse says it cannot access the executable: it's probably still
running from a previous debugging session. Try opening the task manager,
clicking on the Processes tab, and find the executable on the list. Right
click on it and select End Process Tree.
- The application has no compilation errors but you get an error like
"Function 'stoi' could not be resolved". Do the following:
- Browse to the Debug folder and delete the executable.
- In Eclipse, select Project|Clean... and clean the project.
- Select Project|Build Project
You will still get errors about the unresolved symbols, but Eclipse
will build the system anyways!
- Open a command prompt in the Debug folder.
- Run your executable from the command prompt.
Apparently Eclipse is lying about building your project.