Link to home
Start Free TrialLog in
Avatar of StarDusterII
StarDusterII

asked on

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?
Avatar of expert_tanmay
expert_tanmay
Flag of Singapore image

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..
Avatar of StarDusterII
StarDusterII

ASKER

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.
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..
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.
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..
I deleted all the .o's and .d's in the build directory and they get rebuilt as well as the main program.
So now where are you stuck?
Basically, at the start.  I can compile the program but can't run it in debug mode within MonoDevelop.
ASKER CERTIFIED SOLUTION
Avatar of expert_tanmay
expert_tanmay
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Humm... that doesn't look good does it... filed bug in August and no fix yet.