I'm new to C++ and I'm trying to include a header file from this library, https://github.com/Auburns/FastNoiseSIMD
When I write this line, FastNoiseSIMD* myNoise = FastNoiseSIMD::NewFastNoiseSIMD(); I get the error: main.cpp:36: undefined reference to FastNoiseSIMD::NewFastNoiseSIMD(int)
Here is how I'm including the header:
#include "FastNoiseSIMD/FastNoiseSIMD/FastNoiseSIMD.h"
As you can see, the files are in folders that are located in the working directory of my program. I'm working on Linux using c++11 and g++. I don't see any library files that I need to link so I'm stuck here.
Any help is greatly appreciated. Thank you.
Check this undefined-reference-to-pow-and-floor
Related
I'm using rust-cpython to make a python module in rust. I've run my code on a linux os and it runs just fine but I get the familiar "linking with cc failed:exit code 1 error". I've gathered from this that I need to add the .cargo/config file to my project as suggested at the bottom of this:
https://github.com/dgrunwald/rust-cpython
I've copied and pasted their code into a file, config.toml, and place there in a directory, .cargo. I've tried nesting this in my src directory and my project directory with no success, what am I missing?
Solution found: Thought I'd post it as this gave me grief.
Everything with this setup is fine except the config file can't have the extension .toml despite being written in a toml format
I was wondering if anybody managed to set the SDKConfig.h file for the ESP32 when using platform.io to upload code, and if so how it is done.
Thanks in advance!
✌️
You can copy and modify the file SDKConfig.h into your project include folder from:
/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config/
or paste "CONFIG_ULP_COPROC_RESERVE_MEM" in your code and <Ctrl+LClick> to go to this file in your system.
And add this to your platformio.ini so that the file in your project has priority
build_flags =
-Iinclude
Tested with framework-arduinoespressif32 Version 3.10006.210326 (1.0.6)
Let me know if it works for you, I'm guessing it could work with the other frameworks?
if some of the definitions gives you a problem because they are defined elsewhere just add a guard like this:
#ifndef CONFIG_FLASHMODE_DIO
#define CONFIG_FLASHMODE_DIO 1
#endif
This may sound like a very noob question.
I'm trying to implement a UDP-based protocol in the linux kernel. I was following the UDPLite protocol implementation as a reference.
Step 1
I created a new_protocol.c in net/ipv4/
This file has a function
void _init protocol_init(void){*Code here*}
I also used
#include "udp_impl.h"
in this file as I was using some functions from the UDP protocol
Step 2
I modified the file net/ipv4/udp_impl.h to include net/new_protocol.h
Step 3
I created the file include/net/new_protocol.h where I defined the function
void protocol_init(void);
Step 4
Finally, I called the function in net/ipv4/af_inet.c. Also, I gave an include statement in this file for net/new_protocol.h
Now when I try to build the kernel, I get an error saying
undefined reference to `protocol_init()'
What am I missing here? Is my way of including header files incorrect? Do I need to include some info in the makefile to pick up the new net/ipv4/protocol.c?
Do I need to include some info in the makefile to pick up the new net/ipv4/protocol.c?
Yes, you need. Kernel build system doesn't autodetect source files, all of them should be listed explicitely in appropriate Makefile. In you case you need to modify net/ipv4/Makefile.
Makefiles used for kernel build are described in file Documentation/kbuild/makefiles.txt.
I just needed to add protocol.o in the makefile in net/ipv4/
I am new to ejabberd, trying to add new module for offline_message_posturl, on a Windows server. I couldn't find any blog post specifically for Windows other than the below. I am using ejabberd version 15.07.
I have been following this blog post:
http://jasonrowe.com/2011/12/30/ejabberd-offline-messages/
Right now I am not able to create a .beam file from the module file. I get this error:
> c(mod_http_offline).
mod_http_offline.erl:21: undefined macro 'INFO_MSG/2'
mod_http_offline.erl:27: undefined macro 'INFO_MSG/2'
mod_http_offline.erl:44: undefined macro 'INFO_MSG/2'
mod_http_offline.erl:11: function start/2 undefined
mod_http_offline.erl:11: function stop/1 undefined
mod_http_offline.erl:38: function post_offline_message/3 undefined
error
How can I fix this error?
The INFO_MSG macro used to be defined in the header file ejabberd.hrl, but it was moved to logger.hrl in ejabberd 13.06, which was released after that blog post was written. Include logger.hrl as well as ejabberd.hrl, and your file should compile:
-include("ejabberd.hrl").
-include("logger.hrl").
You are not pointing to ejabberd include .hrl file. Simplest approach is probably to add you module to ejabberd src directory and recompile everything.
Otherwise, you can compile your module with erlc using -I to point to ejabberd include dirs (use as many -I directive as needed). For example:
erlc -I ../ejabberd/include mod_http_offline.erl
Hey, I just Downloaded openvrml from macports
(port install openvrml)
Now I have a Sample program (pretty_print.cpp from openvrml at sourceforge) that begins like this:
# ifdef HAVE_CONFIG_H
# include <config.h>
# endif
# include <openvrml/vrml97_grammar.h>
# include <openvrml/browser.h>
# include <fstream>
...
then in Xcode, I added the following path and check "recursive" for the Header search path and Lib Search Path:
/opt/local/var/macports/software
And all '***.h file not found' errors disappeared, but now I have the following two:
complex.h 943 '__pow_helper' is not a member of std
c++locale.h 71 'vsnprintf' is not a member of std
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/complex: In function 'std::complex<_Tp> std::pow(const std::complex<_Tp>&, int)':
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/complex:943: error: '__pow_helper' is not a member of 'std'
both errors come from system files.
I wonder what is causing this errors...
Can anyone advice me on how to use openvrml samples on Macs?
thanks in advance.
I've had a similar problem. I defined "recursive" flag for an '/opt/local/include' path. This pulled in some strange c++ headers from boost compatiblity includes.
In general, you do not want "recursive" flag on your include paths.
Try unchecking "recursive" from your paths.
if you put recursive on a path containing boost headers you'll use some random boost headers, which are likely designed to be used in different environment and/or different compiler, instead of standard C++ headers, meaning, for example, you'll include TR1 header instead of standard header. This is likely to be the cause of your problem (it happened to me too).
Just locate the directory which contains the headers you need and put only that in header search path instead of being lazy and using "recursive" flag, since there are a lot of header files which have same name but differ in location only.