
With the 3DS scene kind of exploding lately, I've decided to see if i can port a C++11 project of mine to the 3DS.
I'm running into the weirdest issue, however..
the following produces errors for me, for some reason. Anyone care to take a look at it? Because I've tried everything I can come up with..
builds fine on windows using Dev-C++(GCC4.8.1), and OSX using Xcode(LLVM6.0/Clang-600.0.054)
on using devkitARM, i'm getting:
Code: Select all
linking tuto.elf
main.o: In function `main':
c:/3dsdev/tuto/source/main.cpp:71: undefined reference to `pt::input::kControllerButtonPressEvent'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/c/3dsdev/tuto/tuto.elf] Error 1
make: *** [build] Error 2
Code: Select all
//InputEnums.hpp
#pragma once
namespace pt {
namespace input {
//controller
extern const unsigned long kControllerButtonPressEvent;
}
}
Code: Select all
//InputEnums.cpp
#include "InputEnums.hpp"
namespace pt {
namespace input {
//controller
const unsigned long kControllerButtonPressEvent = 10010;
}
}
Code: Select all
//main.cpp
#include <iostream>
#include "input/InputEnums.hpp"
int main()
{
auto t = pt::input::kControllerButtonPressEvent;
std::cout << t << std::endl;
return 0;
}