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 07-30-2012, 09:35 AM   #1
User8472
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Rep: Reputation: Disabled
Moving C code from LynxOS to Fedora8


I am trying to move a lot of C code from a LynxOS system to a Fedora 8 system, but I am getting a lot of errors when I try to compile the files on Fedora.

Other than moving the source and makefiles I am not sure what to do - I copied everything that was on the LynxOS system to the Fedora system and moved the C files to the proper locations. The Fedora system does have a C compiler, so it should be able to compile the C files - are there maybe some other files unique to LynxOS that I might need? Or is there some way the C files need to be edited?

Please let me know if you have any suggestions that may help.

Thanks!
 
Old 07-30-2012, 09:46 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
If you post the error messages that you get, we might have an idea. Please post them between [code] and [/code].
 
1 members found this post helpful.
Old 07-30-2012, 11:46 AM   #3
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Do you really have Fedora 8? That was released in 2007 and all support discontinued at the end of 2008. Using an older compiler may cause problems.

Apart from that, there may be discrepancies in the naming of libraries between the two OS: programming languages are not as standardised as one thinks. As Wim says, tell us exactly what the problems are.
 
Old 07-30-2012, 10:33 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As per post#3, I'd get a current(!) distro eg Fedora 17 if you want Fedora, and just copy over only the C src files, then install the C compiler from the Fedora 17 repo and start from there.
 
Old 07-31-2012, 01:08 PM   #5
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
Also, what kind of c code are you talking about? It's one thing to compile "hello world\n" and a whole other to compile glibc.
 
Old 08-02-2012, 10:56 PM   #6
User8472
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Unfortunately newer versions of Fedora will not work on the hardware I have, so I must use Fedora 8.

Also, this is specialized code designed for data acquisition.

I realized that there were some files I did not copy, and now that has fixed most of the errors, however, when I copied the .a libraries, it could not read them (that is now the only compilation error), so I will need to rebuild them. Now I think I know what needs to go in them, but how would I go about creating .a library files on Fedora?
 
Old 08-07-2012, 08:38 AM   #7
User8472
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
I have continued to work on this, and have run into the following errors while trying to compile a group of c files using a makefile:

Code:
gcc -o ./maigret ./maigret.o -L. -lmaigret
./maigret.o: In function `dir':
maigret.c:(.text+0x25): undefined reference to `__iob'
maigret.c:(.text+0x53): undefined reference to `__iob'
maigret.c:(.text+0x144): undefined reference to `__iob'
maigret.c:(.text+0x182): undefined reference to `__iob'
maigret.c:(.text+0x1c1): undefined reference to `__iob'
./maigret.o:maigret.c:(.text+0x1ff): more undefined references to `__iob' follow
collect2: ld returned 1 exit status
What is this `__iob' error? this string does not exist in any of the source files, and I have no idea how to fix it.
 
Old 08-08-2012, 12:17 PM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
io block, io byte

Make your pick My guess is that it's specific to LynxOS or to a certain library that you have installed on the LynxOS system.
 
Old 08-15-2012, 09:20 AM   #9
User8472
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks - I've been looking at that, and now I'm trying to compile a different library for managing sockets.
But when I try to compile it, I get all these errors:

Code:
gcc -I. -c -O2 -o ./ip_com.o ./ip_com.c
In file included from ./ip_com.c:25:
/usr/include/sys/socket.h:21:2: warning: #warning Using <socket.h> instead of <sys/socket.h>
In file included from ./ip_com.c:26:
/usr/include/sys/time.h:21:2: warning: #warning Using <time.h> instead of <sys/time.h>
In file included from ./ip_com.c:32:
/usr/include/sys/errno.h:21:2: warning: #warning Using <errno.h> instead of <sys/errno.h>
In file included from ./ip_com.c:29:
/usr/include/netinet/in.h:219: error: expected specifier-qualifier-list before ‘__SOCKADDR_COMMON’
/usr/include/netinet/in.h:233: error: expected specifier-qualifier-list before ‘__SOCKADDR_COMMON’
/usr/include/netinet/in.h:281: error: field ‘gr_group’ has incomplete type
/usr/include/netinet/in.h:290: error: field ‘gsr_group’ has incomplete type
/usr/include/netinet/in.h:293: error: field ‘gsr_source’ has incomplete type
/usr/include/netinet/in.h:325: error: field ‘gf_group’ has incomplete type
/usr/include/netinet/in.h:333: error: array type has incomplete element type
In file included from ./ip_com.c:29:
/usr/include/netinet/in.h: In function ‘ntohl’:
/usr/include/netinet/in.h:352: error: expected declaration specifiers before ‘__THROW’
/usr/include/netinet/in.h:354: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__THROW’
/usr/include/netinet/in.h:356: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__THROW’
/usr/include/netinet/in.h:358: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__THROW’
In file included from ./ip_com.c:29:
/usr/include/netinet/in.h:426: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__THROW’
/usr/include/netinet/in.h:430: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__THROW’
In file included from ./ip_com.c:30:
/usr/include/netdb.h:86: error: storage class specified for parameter ‘gethostbyname’
/usr/include/netdb.h:87: error: storage class specified for parameter ‘gethostbyaddr’
/usr/include/netdb.h:88: error: storage class specified for parameter ‘gethostent’
/usr/include/netdb.h:89: error: storage class specified for parameter ‘getnetbyname’
/usr/include/netdb.h:90: error: storage class specified for parameter ‘getnetbyaddr’
/usr/include/netdb.h:91: error: storage class specified for parameter ‘getnetent’
/usr/include/netdb.h:92: error: storage class specified for parameter ‘getservbyname’
/usr/include/netdb.h:93: error: storage class specified for parameter ‘getservbyport’
/usr/include/netdb.h:94: error: storage class specified for parameter ‘getservent’
/usr/include/netdb.h:95: error: storage class specified for parameter ‘getprotobyname’
/usr/include/netdb.h:96: error: storage class specified for parameter ‘getprotobynumber’
/usr/include/netdb.h:97: error: storage class specified for parameter ‘getprotoent’
/usr/include/netdb.h:112: error: storage class specified for parameter ‘_h_errno’
In file included from ./ip_com.c:31:
/usr/include/sys/file.h:239: error: storage class specified for parameter ‘findpath’
/usr/include/sys/file.h:240: error: storage class specified for parameter ‘flock’
In file included from /usr/include/sys/errno.h:26,
                 from ./ip_com.c:33:
/usr/include/errno.h:258: error: storage class specified for parameter ‘_errno’
/usr/include/errno.h:261: error: storage class specified for parameter ‘_errno’
/usr/include/errno.h:261: error: redefinition of parameter ‘_errno’
/usr/include/errno.h:258: error: previous definition of ‘_errno’ was here
In file included from /usr/include/malloc.h:23,
                 from ./ip_com.c:34:
/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h:152: error: storage class specified for parameter ‘ptrdiff_t’
/usr/lib/gcc/i386-redhat-linux/4.1.2/include/stddef.h:326: error: storage class specified for parameter ‘wchar_t’
In file included from ./ip_com.c:34:
/usr/include/malloc.h:30: error: storage class specified for parameter ‘malloc’
/usr/include/malloc.h:31: error: storage class specified for parameter ‘calloc’
/usr/include/malloc.h:32: error: storage class specified for parameter ‘realloc’
/usr/include/malloc.h:33: error: storage class specified for parameter ‘free’
In file included from ./ip_com.c:35:
./ip_com.h:75: warning: empty declaration
./ip_com.h:79: error: storage class specified for parameter ‘report_errors’
./ip_com.h:81: error: storage class specified for parameter ‘init_socket_parms’
./ip_com.h:84: error: storage class specified for parameter ‘init_socket’
./ip_com.h:107: error: storage class specified for parameter ‘accept_socket’
./ip_com.h:118: error: storage class specified for parameter ‘connect_socket’
./ip_com.h:122: error: storage class specified for parameter ‘close_socket’
./ip_com.h:127: error: storage class specified for parameter ‘nslookup’
./ip_com.h:131: error: storage class specified for parameter ‘nsaliases’
./ip_com.h:134: error: storage class specified for parameter ‘isip’
./ip_com.h:137: error: storage class specified for parameter ‘block_socket’
./ip_com.h:140: error: storage class specified for parameter ‘noblock_socket’
./ip_com.h:143: error: storage class specified for parameter ‘raw_read’
./ip_com.h:148: error: storage class specified for parameter ‘probe_read_socket’
./ip_com.c:36: error: parameter ‘report_errors’ is initialized
./ip_com.c:36: error: redefinition of parameter ‘report_errors’
./ip_com.h:79: error: previous definition of ‘report_errors’ was here
./ip_com.c:38: error: redefinition of parameter ‘init_socket’
./ip_com.h:84: error: previous definition of ‘init_socket’ was here
./ip_com.c:39: error: redefinition of parameter ‘close_socket’
./ip_com.h:122: error: previous definition of ‘close_socket’ was here
./ip_com.c:40: error: redefinition of parameter ‘nslookup’
./ip_com.h:127: error: previous definition of ‘nslookup’ was here
./ip_com.c:41: error: redefinition of parameter ‘nsaliases’
./ip_com.h:131: error: previous definition of ‘nsaliases’ was here
./ip_com.c:42: error: redefinition of parameter ‘isip’
./ip_com.h:134: error: previous definition of ‘isip’ was here
./ip_com.c:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:71: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:169: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:187: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:215: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:268: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:310: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:317: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:323: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:329: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:386: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:417: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
./ip_com.c:433: error: old-style parameter declarations in prototyped function definition
./ip_com.c:433: error: expected ‘{’ at end of input
make: *** [ip_com.o] Error 1
Can anyone make sense of that? it looks like it is having trouble with system code that should work already.
 
Old 08-16-2012, 12:35 AM   #10
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Sorry, can't help you further at this moment.

This question might also be better off in the programming section. I will report your post with the request to move it there.
 
Old 08-16-2012, 03:26 PM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <PROGRAMMING> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 08-16-2012, 11:01 PM   #12
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Start with the warnings: in ip_com.c change these lines:
Code:
25 #include <socket.h>
26 #include <time.h>
32 #include <errno.h>
 
  


Reply

Tags
code, fedora 8, linux, lynx, programming



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
LynxOS disk Clone flyingrobertybob Linux - Newbie 7 09-21-2014 02:52 AM
LynxOS questions Jake Zero Linux - Newbie 1 03-29-2012 10:31 AM
Moving Document Root in Fedora8/Apache mtlhd Linux - Server 3 04-21-2008 09:27 AM
LXer: Linux: Moving and Changing Code LXer Syndicated Linux News 0 07-17-2007 12:31 AM
Help moving mouse with code. nonconformative Programming 1 12-02-2003 06:44 PM

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

All times are GMT -5. The time now is 03:40 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