LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2005, 09:14 PM   #1
mintong
LQ Newbie
 
Registered: Jul 2005
Posts: 3

Rep: Reputation: 0
unresolved symbol htons


when i insmod my driver ,i get an error:
insmod :unresolved symbol htons
insmod :unresolved symbol ntons

and then i add the <linux/byteorder/generic.h> and the <asm/byteorder.h>
when i compile ,gcc give the err:
linux/byteorder/generic.h:150 parse error before htons....

if smby can tell me what's the problem now
 
Old 07-28-2005, 01:22 AM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
try including
linux/netdevice.h
and that will include asm/byteorder.h
 
Old 08-01-2005, 12:49 AM   #3
mintong
LQ Newbie
 
Registered: Jul 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Re: unresolved symbol htons

thanks,but

i have include the <linux/netdevice.h>
 
Old 08-01-2005, 01:17 AM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
look at
include/linux/byteorder/generic.h
Code:
#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)

#define ___htonl(x) __cpu_to_be32(x)
#define ___htons(x) __cpu_to_be16(x)
#define ___ntohl(x) __be32_to_cpu(x)
#define ___ntohs(x) __be16_to_cpu(x)

#define htonl(x) ___htonl(x)
#define ntohl(x) ___ntohl(x)
#define htons(x) ___htons(x)
#define ntohs(x) ___ntohs(x)

#endif /* OPTIMIZE */
so while you give us little to go on and make us guess
in order to have htons macro defined you must use -O2 when compiling

might be other issues -- like i said you make us guess
you even hid what version of the kernel you are using
 
Old 08-03-2005, 09:53 PM   #5
mintong
LQ Newbie
 
Registered: Jul 2005
Posts: 3

Original Poster
Rep: Reputation: 0
thanks,

because i havn't time to do that these days , i read the thread later!


i will try to compile with -O2;if there is some problem ,i will post all info here

thanks again!!!
 
  


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
unresolved symbol haddon Linux - Hardware 3 03-11-2005 02:24 PM
Unresolved symbol? Elonch Programming 2 03-01-2005 11:48 PM
unresolved symbol unregister_sound_special Daeljan Slackware 3 11-19-2004 06:22 PM
Unresolved symbol: xtime_lock stuartx Linux - General 0 10-27-2004 02:05 PM
unresolved symbol issues galois Linux - Software 0 01-06-2002 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:35 PM.

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