I have been using Mega2560 until now, but now I changing to Due. Gives error: 't

I also asked this question at the Visualmicro forum!

I have been using Mega2560 until now, but now I changing to Due.
When I compile it complains about this:
Severity Code Description Project File Line
Error 122:18: error: 'time_t' has a previous declaration as 'typedef long int time_t c:\users\matz\appdata\roaming\arduino15\packages\arduino\tools\arm-none-eabi-gcc
\4.8.3-2014q1\arm-none-eabi\include\sys\types.h 122

It seems that time_t does not like to be re declared. Anyone know how to fix this?

Regards

It doesn't like to be declared because it already is... Depending on what you want (and we don't know) the declaration might already be fine.

Anyone know how to fix this?

Of course. Don't re-declare it.

Ok, I admit, I gave you to little info.

The Mega2560 was used until now in my project. Today I am start testing Due board instead. I using Visualmicro in VS2015. My hope was/is that the Due using the same libraries as the Mega2560 so the transition to Due will be easy.

I installed the Due and tried to compile. The compiler gave me the error about the re-declaration. I read that this was a known problem, but I did not really find any solution. One solution was to install a new library, but I read that it was different problem with the library, MarkusLange/Arduino-Due-RTC-Library.
Any one tested that library?
Any one knows about any other differences regarding libraries or other problem?
And what can I do to fix the error about the re-declaration, is it to use another RTC library?

Regards

My hope was/is that the Due using the same libraries as the Mega2560 so the transition to Due will be easy.

Oh, dear. Starting with an unrealistic expectation is never a good thing.

I installed the Due and tried to compile.

Some code that we still haven't seen.

I read that this was a known problem, but I did not really find any solution.

I've read lots of nonsense on the internet. I've failed to find solutions to problems, too. But, then I don't often post "It doesn't work" type threads without a boatload more information than you've provided so far.

And what can I do to fix the error about the re-declaration, is it to use another RTC library?

I told you. Stop making a duplicate declaration.

If you need help with that, you really must tell us what library is causing you problems. There just is no other way.

Haha, I like the comment "unrealistic expectation".

What, have you read nonsense on Internet, were? :wink:

You want some code, here is a small project that worked fine with the Mega2560:

#include <SPI.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <utility\util.h>

// enter desired IP-address and port number below
IPAddress ip(192,168,137,52);
word port = 33000;

#include "U8glib.h" // graphics library for Display
U8GLIB_NHD27OLED_2X_GR u8g(31, 9, 8);

void setup() {
Serial.begin(4800);
Serial.write(highByte(port));
Serial.write(lowByte(port));
for(unsigned int i = 0; i<4 ;i++){
Serial.write(ip*);*

  • }*
    }
    void loop() {
  • draw(); *
    }
    void draw(void){
  • u8g.firstPage();*
  • u8g.setColorIndex(3);*
  • do{*
  • u8g.setFont(u8g_font_8x13B);*
  • u8g.drawStr(3,15,"Set Up complete");*
  • u8g.drawStr(5,30,"IP: "); *
  • u8g.drawStr(7,45, "Port: ");*
  • u8g.setFont(u8g_font_6x12r);*
  • u8g.setPrintPos(30,30);*
  • u8g.print(ip);*
  • u8g.setPrintPos(50,45);*
  • u8g.print(port);*
  • }while( u8g.nextPage() );*
  • delay(200);*
    }
    With the Due it complains about the re-declaration, I don't like that, it is bad!
    I wonder if I missed something obvious or can I expect more of these types of errors when I fix this one???
    The two declarations were at ICMPPing and in
    c:\users\matz\appdata\roaming\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\sys\types.h.
    I renamed the one in ICMPPing from time_t to ltime_t (typedef unsigned long ltime_t;). Now it does not complain about that, now it is new errors.
    Regards

I renamed the one in ICMPPing from time_t to ltime_t (typedef unsigned long ltime_t;).

As opposed to just commenting it out?

now it is new errors.

You don't need help with them, I presume, or you would have posted them.

You want some code, here is a small project that worked fine with the Mega2560:

// enter desired IP-address and port number below
IPAddress ip(192,168,137,52);
word port = 33000;

#include "U8glib.h" // graphics library for Display
U8GLIB_NHD27OLED_2X_GR u8g(31, 9, 8);

void setup() {

Including the 8) ?