Page 1 of 1

undefined reference to `n_file_record'

Posted: Mon Dec 28, 2009 1:48 pm
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.

Re: undefined reference to `n_file_record'

Posted: Tue Dec 29, 2009 10:23 am
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.

Re: undefined reference to `n_file_record'

Posted: Wed Dec 30, 2009 7:59 pm
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.

Re: undefined reference to `n_file_record'

Posted: Thu Dec 31, 2009 8:39 am
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

Re: undefined reference to `n_file_record'

Posted: Mon Jan 18, 2010 4:36 pm
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.

Re: undefined reference to `n_file_record'

Posted: Mon Jan 18, 2010 7:23 pm
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.

Re: undefined reference to `n_file_record'

Posted: Tue Jan 19, 2010 10:32 am
by Forrest
Hello,

Can you copy/paste your full build log after doing a make clean? What version of the NNDK are you using?

Re: undefined reference to `n_file_record'

Posted: Tue Jan 19, 2010 11:19 am
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.

Re: undefined reference to `n_file_record'

Posted: Tue Jan 19, 2010 12:28 pm
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.

Re: undefined reference to `n_file_record'

Posted: Wed Jan 20, 2010 4:50 pm
by macpherson
I am using HTTP. I attach a screenshot of Eclipse.

Thanks,
Ewan.