• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 501
  • Last Modified:

How to set up a reference to gsm in MonoDevelop

I need to modify a c program and have been using MonoDevelop 2.4.2 on openSUSE 11.3 as the IDE.  I use MonoDevelop for C# on a lot of other programs so I'd like to be able to use it with the C programs too.

The c program compiles on the command line but when I'm in MonoDevelop it gives me errors on references to gsm functions:

Error: undefined reference to `gsm_encode'
Error: undefined reference to `gsm_option'
... etc...

Very new to c so can someone tell me how can I reference those so I can debug and compile in MonoDevelop?
0
StarDusterII
Asked:
StarDusterII
  • 5
  • 5
1 Solution
 
expert_tanmayCommented:
Do you have gsm_encode, gsm_option in your c code. if this two are functions from other libraries you need to #include the header file in your code and if these are functions in your code itself define a prototype before you call them.

Cheers..
0
 
StarDusterIIAuthor Commented:
I do have gsm_encode and gsm_option, but I also have the gsm header file.  I did find a way to set up MonoDevelop to use the makefile and it compiles now but won't run the program.  When I try to run/debug, it just says make 'myProgram' is up to date.
0
 
expert_tanmayCommented:
A Make rule is composed of:

target: prerequisites
      commands

A target is considered "up to date" if it exists and is newer than its prerequisites. For example

example.o: example.c defs.h
            cc -c example.c

here example.o is the target, if example.o is newer than example.c and defs.h that shows you have a compiled target. Either delete example.o or make some changes to example.c

Cheers..
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
StarDusterIIAuthor Commented:
Not sure you understood... It compiles and mak runs fine... hence the output "myProgram" is up to date.  The problem is that after it's made, it won't "run" in MonoDevelop.  Whenever I try to run, all it does is build the project or tell me it's up to date.
0
 
expert_tanmayCommented:
Delete the myProgram.o file that is the object file and rebuild. If the object file is getting created and then you are getting some problem we will dig through the linking problem..

Cheers..
0
 
StarDusterIIAuthor Commented:
I deleted all the .o's and .d's in the build directory and they get rebuilt as well as the main program.
0
 
expert_tanmayCommented:
So now where are you stuck?
0
 
StarDusterIIAuthor Commented:
Basically, at the start.  I can compile the program but can't run it in debug mode within MonoDevelop.
0
 
expert_tanmayCommented:
Oh ok debug of c and c++ is still a bug with MonoDevelop. Please refer to http://go-mono.com/forums/#nabble-td2304192. It works well only with C#.

Cheers..
0
 
StarDusterIIAuthor Commented:
Humm... that doesn't look good does it... filed bug in August and no fix yet.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now