Skip to content

Need help from a C programmer please

Featured Replies

Hi All

I did some playing about with C a while ago and as a result ended up with a program that does something specific for my needs. However, I have recently had to change it slightly, and found that I had lost the project files. I am therefore now trying to recreate it on my Linux box which worked fine last time. When I issue the gcc - c command to compile the .c file, I get an error saying pm.h: No such file or directory. The first lines of the code look like this:

#include

#include

int main(void)

{

[snip]

As you can see, I am using pm.h. This would have worked fine for me before as I am working on the same source files. The only difference is that my Linux box is now different. Any ideas? The compiling is also throwing more errors up after, but I am guessing this is because this library is missing.

Cheers

Gary

You need to look in /usr/include directory and subdirectories to see if pm.h has moved. By default it will only look in /usr/include...

Are you moving this program from Windows or another Unix to Linux?

Chris

In fact, having a Google, it looks like yit's moved and ou need to change it to:

#include

Chris

What 'e said ;)

^ fancy not knowing that :)

  • Author
In fact, having a Google, it looks like yit's moved and ou need to change it to:

#include

Chris

Yep, that sorted that one cheers :thumbup: Trouble is, I am now getting

>> warning: implicit declaration of function ABS <<

and

>> undefined reference to `ABS' <<

Followed by :

>> collect2: ld returned 1 exit status <<

I am clearly working on a previous source file, and must have lost the one I had working :mad:

Sorry for the dumb questions! I did start to learn C but had to ditch it to concentrate on Linux, Windows, Citrix, and the like. Brain couldn't take much more at the time :rolleyes: I am OK with programming in general (mainly VB, Bash, PHP, etc.), but don't have enough C knowledge to debug.

Sounds like you're calling a function it doesn't know about. My guess is it should be abs which is a standard C API for the absolute value....

The ld just means the linker failed to create the executable/library because of the first error.

Chris

  • Author
Sounds like you're calling a function it doesn't know about. My guess is it should be abs which is a standard C API for the absolute value....

The ld just means the linker failed to create the executable/library because of the first error.

Chris

Way to go! Just a matter of changing ABS to abs then :thumbup: Works great now.

Cheers Chris ;)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Important Information

Welcome to BRISKODA. Please note the following important links Terms of Use. We have a comprehensive Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.