Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 14:38
    Deoxys0 opened #638
  • Sep 29 23:46
    lganzzzo commented #636
  • Sep 29 20:00
    lganzzzo labeled #637
  • Sep 29 19:59
    lganzzzo commented #637
  • Sep 29 13:52
    patlecat opened #637
  • Sep 29 13:00
    corner4world edited #636
  • Sep 29 12:59
    corner4world opened #636
  • Sep 29 02:28
    chengpengvb closed #635
  • Sep 29 02:28
    chengpengvb commented #635
  • Sep 29 02:16
    chengpengvb opened #635
  • Sep 28 20:47
    lganzzzo commented #595
  • Sep 28 19:03
    n3world opened #634
  • Sep 28 18:58
    n3world opened #633
  • Sep 27 21:43
    erenkeskin edited #632
  • Sep 27 21:43
    erenkeskin edited #632
  • Sep 27 21:41
    erenkeskin edited #632
  • Sep 27 21:38
    erenkeskin opened #632
  • Sep 27 14:00
    kevinbenson1 edited #631
  • Sep 27 14:00
    kevinbenson1 edited #631
  • Sep 26 22:08
    kevinbenson1 edited #631
Albert Stack
@MrStack
auto insController = std::make_shared<Controller>();
insController->addEndpointsToRouter(router);    
oat++
@oatpp_io_twitter

Hello @MrStack ,

Now, in 1.3.0, you can just do the following:

router->addController(std::make_shared<Controller>());
You can check how it's done in examples - https://github.com/oatpp/example-crud/blob/master/src/App.cpp#L24
Albert Stack
@MrStack
@oatpp_io_twitter Thanks a lot! It works fine!
AlexandreHURDYK
@AlexandreHURDYK
Hello. I'm trying to compile oat++ libraries for Linux ARM 32 bits but I can't seem to make it work. Is there an easy way to do that ?
1 reply
mmn
@mmn:matrix.org
[m]
What OS exactly?
AlexandreHURDYK
@AlexandreHURDYK
It's not a specific distribution : it's something specifically made by my company. It's just a 32 bits ARM Linux at core.
mmn
@mmn:matrix.org
[m]
And with what exactly in the process 1) install the dependencies (cmake, compiler etc.) 2) run cmake 3) run make are you having issues?
AlexandreHURDYK
@AlexandreHURDYK

Well first we tried to run the following commands :

$ git clone https://github.com/oatpp/oatpp.git
$ cd oatpp/
$ unset LD_LIBRARY_PATH
$ source /opt/phytec-yogurt/BSP-Yocto-i.MX6-PD18.1.1/environment-setup-cortexa9hf-neon-phytec-linux-gnueabi
$ mkdir build && cd build
$ cmake .. 
$ make install

Cmake build worked, but linux compilation in our program failed. We discovered that it was because these libraries were in 64 bits instead of 32 bits. So we tried this :

$ git clone https://github.com/oatpp/oatpp.git
$ cd oatpp/
$ unset LD_LIBRARY_PATH
$ source /opt/phytec-yogurt/BSP-Yocto-i.MX6-PD18.1.1/environment-setup-cortexa9hf-neon-phytec-linux-gnueabi
$ mkdir build && cd build
$ cmake .. -DCMAKE_CXX_FLAGS=-m32
$ make install

Cmake build worked as well. Libraries seemed to be 32 bits . I try to put the libraries in my actual application but now the libraries are actually ignored by our linker because they're "incompatible".

We're having trouble to make something that can be compiled on a Linux 32 bits ARM distribution through Yocto basically.
mmn
@mmn:matrix.org
[m]
Oat++ is quite small, I'd try first to compile it directly on some armhf distro instead of cross-compiling.
What arch is the machine you are compiling it on?
AlexandreHURDYK
@AlexandreHURDYK
So basically compiling it directly on our small Linux embarked system ?
We're compiling on kubuntu.
2 replies
mmn
@mmn:matrix.org
[m]
Yeah, even an old raspberry pi should work, or just run a minimal system in qemu.
If you succeed there, you can then play around with cross-compiling.
BTW, what error (about the incompatibility) you get from the linker?
AlexandreHURDYK
@AlexandreHURDYK
It just says "skipping incompatible ../ext/oatpp-1.3.0/lib/cortexa9hf_neon_Release/liboatpp.a when searching for -l:liboatpp.a" as an information message
And then we get "collect2: error: ld returned 1 exit status" probably because the linker couldn't find the skipped libraries.
1 reply
mmn
@mmn:matrix.org
[m]
So you actually succeeded to build oat++, but couldn't link to it, right?
AlexandreHURDYK
@AlexandreHURDYK
Pretty much.
Probably we didn't build it right for our embarked platform.
mmn
@mmn:matrix.org
[m]
The machine on which you compiled it wasn't arm, that's what I meant.
And of course there is ubuntu for arm.
AlexandreHURDYK
@AlexandreHURDYK
Yeah I don't think that kubuntu distribution was arm either.
Is there a way to check and be sure about my kubuntu version ?
mmn
@mmn:matrix.org
[m]
uname -a
Will tell you the arch for sure.
AlexandreHURDYK
@AlexandreHURDYK
Linux LX379-agurdyk 5.4.0-90-generic #101~18.04.1-Ubuntu SMP Fri Oct 22 09:25:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
mmn
@mmn:matrix.org
[m]
OK, so you are trying to cross-compile it from an x86_64 machine.
AlexandreHURDYK
@AlexandreHURDYK
Yeah. Target machine is 32 bits (so technically x86 right ?).
mmn
@mmn:matrix.org
[m]
No.
There is a ton of 32bit architectures.
x86 being only one of them, armhf (your target) another.
AlexandreHURDYK
@AlexandreHURDYK
Ouch
To things weren't even really compatible to begin with.
mmn
@mmn:matrix.org
[m]
So, if you have access to an old raspberry pi, that would be the easiest way to build it for your target (armhf) architecture.
Another option is to use qemu virtualisation.
AlexandreHURDYK
@AlexandreHURDYK
I don't think we have something like that, but maybe we can use the piece of hardware we're using that hosts our homemade OS in the same way. I'll try to ask a coworker.
If all else fails, it's qemu time to emulate a raspberry PI, right ?
mmn
@mmn:matrix.org
[m]
What are the ram/storage capacities of your target hw?
AlexandreHURDYK
@AlexandreHURDYK
No idea. Perhaps I can check with a command ?
mmn
@mmn:matrix.org
[m]
You don't know the device you are developing for?
AlexandreHURDYK
@AlexandreHURDYK
It's literaly a circuit board with an home made OS inside. Jobplace gave this to me monday without much precisions and told me to make my program work on that circuit board.
So I'm afraid that I lack a lot of critical information about what that improvised computer can do.
:/
I can however try to ask a coworker in a few minutes.
mmn
@mmn:matrix.org
[m]
Okay, but then that's maybe not a question for this forum. If you are going to cross-compile for an embedded device, that's quite a specialised discipline... I can try to compile oat++ on my lime2 this afternoon (which is 32 bit arm), but that one runs a full debian distro.
AlexandreHURDYK
@AlexandreHURDYK
All I should need is the two static library files so maybe just doing that on that debian distribution could work.
mmn
@mmn:matrix.org
[m]
What do you get after running
file ../ext/oatpp-1.3.0/lib/cortexa9hf_neon_Release/liboatpp.a
(replace the path with your actual path, of course)