LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-20-2015, 02:04 PM   #1
MPH426
LQ Newbie
 
Registered: Feb 2013
Posts: 23

Rep: Reputation: Disabled
gcc compile errors... after update... I think.


Hi all,

I don't do much c programming, but I've been working on an inotify routine to watch a directory for changes. The last time I compiled the program was about 3 weeks ago. I tried to compile the exact same program today and I'm getting this.

Code:
>gcc -o create-close create-close.c
/tmp/ccvm5h7h.o: In function `main':
create-close.c:(.text+0x94): undefined reference to `inotifytools_initialize'
create-close.c:(.text+0xac): undefined reference to `inotifytools_watch_recursively'
create-close.c:(.text+0xb5): undefined reference to `inotifytools_error'
create-close.c:(.text+0xef): undefined reference to `inotifytools_set_printf_timefmt'
create-close.c:(.text+0xfb): undefined reference to `inotifytools_next_event'
create-close.c:(.text+0x12e): undefined reference to `inotifytools_printf'
create-close.c:(.text+0x13a): undefined reference to `inotifytools_next_event'
collect2: ld returned 1 exit status
The C file has not changed, so I'm a little confused. I have run some system updates (CentOS 6) and think that may be the culprit. My internet searches only show include and library related issues. I've tried those suggestions to no avail.

Any idea why this would be happening, things to look for, etc..?

Thanks,

MPH
 
Old 03-20-2015, 03:30 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Does this not work?
Code:
gcc -o create-close create-close.c -linotifytools
 
2 members found this post helpful.
Old 03-21-2015, 09:54 AM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,880
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Either put the libraries to the end, or use flag: -Wl,--no-as-needed.
 
Old 03-23-2015, 07:28 AM   #4
MPH426
LQ Newbie
 
Registered: Feb 2013
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by norobro View Post
Does this not work?
Code:
gcc -o create-close create-close.c -linotifytools
I knew I was forgetting something. Thanks! I did not see that in my searches...

Most of what I do in C is text file manipulation. Not many options needed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc compile errors pepsimachine15 Programming 1 04-16-2009 10:36 PM
Compile 2.2.26 Kernel with GCC 2.95.3: Errors bapigoo9 Programming 4 12-17-2008 10:47 PM
Nvu by gcc 4.0 .. compile errors! TokyoYank Linux - Software 0 11-01-2005 02:15 AM
gcc-3.3.1 compile errors RTT Linux From Scratch 1 02-28-2004 06:53 PM
gcc compile errors ? qwijibow Linux - Newbie 2 07-21-2003 07:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration