undefined reference to `n_file_record'

Discussion to talk about software related topics only.
Post Reply
macpherson
Posts: 38
Joined: Tue Jun 03, 2008 10:26 am

undefined reference to `n_file_record'

Post by macpherson »

After over a year of using Eclipse with NB software I get the following link problem. This is on my desktop. My laptop is still fine.
Invoking: GNU C/C++ Linker
m68k-elf-g++ -m5206e -Wl -Wl,-n -T"C:\Nburn\MOD5270\lib\MOD5270.ld" -Wl,-R"C:\Nburn\MOD5270\lib\sys.ld" -Wl,-Map="ServerNB.map" ./Clock.o ./HardDrives.o ./I2C.o ./Incomming.o ./Modem.o ./NIST.o ./Protocol.o ./Reports.o ./Shutdown.o ./WebFunctions.o ./eeprom.o ./ethernet.o ./ftps.o ./main.o ./tzo.o ./html/htmldata.o -Wl,--start-group,"C:\Nburn\lib\MOD5270.a" "C:\Nburn\lib\NetBurner.a" "C:\Nburn\lib\FatFile.a" -Wl,--end-group -o"ServerNB.elf"
C:\\\\Nburn\\\\lib\\\\NetBurner.a(htmldecomp.o)(.text+0x26): In function `GetRecordFromName(char*)':
c:\release\nburn\system/htmldecomp.cpp:85: undefined reference to `n_file_record'
C:\\\\Nburn\\\\lib\\\\NetBurner.a(htmldecomp.o)(.text+0x5e):c:\release\nburn\system/htmldecomp.cpp:87: undefined reference to `file_record'
C:\\\\Nburn\\\\lib\\\\NetBurner.a(htmldecomp.o)(.text+0x186): In function `SendHtml(int, char*, int, char const*)':
c:\release\nburn\system/htmldecomp.cpp:175: undefined reference to `html_table'
There are several more errors.

By the way, there is no directory "c:\release\nburn\system".

I then copied all my still working code from my laptop to my desktop with no improvement. I then uninstalled and reinstalled the NB software including the NBDK and DEV C++. and still no change.

Any ideas?

Thanks in advance.
Ewan.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: undefined reference to `n_file_record'

Post by rnixon »

NBEclipse and DevCpp are two completely different IDEs, so I'm not sure what that would have to do with anything. But it sounds like you are including the htmldata.cpp file in your project. Since its an autogenerated file, you don't want to do that.
I would try importing and building one of the samples to verify the tools. You always need to install the tools, they cannot be copied from one machine to another. Neither can a project. You need to create a new project on each machine and import the source files into it.
macpherson
Posts: 38
Joined: Tue Jun 03, 2008 10:26 am

Re: undefined reference to `n_file_record'

Post by macpherson »

I have no idea where "htmldata.cpp" is. I have not included it and, as I said, I copied all my code (including project info etc.) to my desktop and it works in my laptop with the same directory structure. I originally copied that same code to the laptop with great success.

What do you make of the linker's reference to an nonexistent directory?

Regards,
Ewan.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: undefined reference to `n_file_record'

Post by rnixon »

Hi Ewan,

I have not ever had any luck copying projects and directory structures between machines - only source code files. Have you tried a test by creating a new project on the machine in question, then importing the source code files?

By default, n_file_record is located in htmldata.cpp, which is located in your project's release directory. Another possibility is that you did not copy the html folder over from the other machine, so the system can't build the htmldata.cpp file
macpherson
Posts: 38
Joined: Tue Jun 03, 2008 10:26 am

Re: undefined reference to `n_file_record'

Post by macpherson »

rnixon,

You are right in that the problem lies with the file "htmldata.cpp". Eclipse only regenerates the following automatically.

Code: Select all

/*Autogenerated data file */
#include "htmlfiles.h"

const char * default_page="INDEX.HTM";


int DoHtmlFunction(int fd, PCSTR url,WORD n) { return 0; };
If I add what is required, all compiles fine. If I do a make-clean, however it only regenerates the same skeleton. What causes this?

Thanks.
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: undefined reference to `n_file_record'

Post by rnixon »

Eclipse will attempt to create htmldata.cpp based on your project's html folder and all sub folders under it. If it is not working correctly, it may be that your paths are messed up. Paths can be messed up if you copied any of the system folders, because the environment variables and windows registry won't know about it. A quick test to determine if this is the problem would be to rename your current tools installation directory, install to c:\nburn, then import your project and see if it works. There are so may files and paths involved I can't imagine how you would correct the problem if it is indeed because of copying.
User avatar
Forrest
Posts: 288
Joined: Wed Apr 23, 2008 10:05 am

Re: undefined reference to `n_file_record'

Post by Forrest »

Hello,

Can you copy/paste your full build log after doing a make clean? What version of the NNDK are you using?
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
macpherson
Posts: 38
Joined: Tue Jun 03, 2008 10:26 am

Re: undefined reference to `n_file_record'

Post by macpherson »

Please find my clean log attached.

The warnings at the start were always there and did not seem to cause trouble. The issue seems to be that the file "htmldata.cpp" is not being fully generated even though the html and image files are in their correct locations.

The version of Eclipse seems to be 3.1.0 with variations and the parts provided by NB are version 1.2.0.

I did what rnixon suggested. I renamed my Nburn directory to Nburn.old the reinstalled. No improvement.

Thaks to all for your interest and help.

Ewan.
Attachments
Clean.log
(7.11 KiB) Downloaded 378 times
User avatar
Forrest
Posts: 288
Joined: Wed Apr 23, 2008 10:05 am

Re: undefined reference to `n_file_record'

Post by Forrest »

I don't see the html directory building. Do you have an html directory? Are you using the web page? The html directory must be in your project root. If you are not using html, be sure to take StartHTTP() out of your init code.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
macpherson
Posts: 38
Joined: Tue Jun 03, 2008 10:26 am

Re: undefined reference to `n_file_record'

Post by macpherson »

I am using HTTP. I attach a screenshot of Eclipse.

Thanks,
Ewan.
Attachments
Eclipse.jpg
Eclipse.jpg (321.68 KiB) Viewed 8054 times
Post Reply