We are compiling fmt with the Intel C compiler on Windows 32bit and 64 bit. On 32 bit we get a strange error. Maybe we are doing something wrong but the issue is what? Here is the error message:
../master/extern/fmt/8.0.1/include/fmt/format-inl.h(1126): error: expression must have a constant value
static constexpr const uint128_wrapper pow10_significands[] = {
^
Any suggestions for a fix? We could potentially build with MSVC.
Update: format-inl.h (=inline format) is only supposed to be used in a header only mode as far I understand and that is not what I want and has not turned on. So I have to figure why this happens.
PS: fmt is great.
The expression in question is constant so this looks like a bug in the compiler or possibly incomplete implementation of constexpr. The error message is misleading but you might be able to workaround the issue by removing constexpr or some other way.
Have you tried building with a C++17 compiler? constexpr isn’t a C keyword afaik.
Related
Having trouble finding a sufficiently precise answer, basically my compiler (GCC std=c++11) does recognise the type "Object".
Yes, I am fairly new to ++
Tried changing command line options, tried Googling for an exact solution.
If anyone spots any other potential issues, please do let me know. I am finding the NodeJS docs a bit ambiguous in some areas.
I have included my code and command line output.
Command line snippet:
g++ exampleMod.c -I/usr/include/c++/4.8.5 -I/lhome/psyjw21/node-v10.16.3-linux-x64/include/node -I /usr/include/c++/4.8.5/x86_64-redhat-linux -std=c++11
exampleMod.c:7:1: error: ‘Object’ does not name a type
Object obj = Object::New(env);
The code:
#define NAPI_VERSION 3
#include <node.h>
#include <node_buffer.h>
#include <node_version.h>
#include <node_object_wrap.h>
Object obj = Object::New(env);
obj["foo"] = String::New(env, "bar");
Never mind - I have found the problem.
I included what was meant to be part of the Javascript in my C++ file.
obj["foo"] - I kind of realised what I did when I saw I had used a string as an array index... that isn't going to work in C++! (actually, I need to check a few things because I didn't think you could do it Javascript either).
Anyway, yes, feel free to comment on what a dumb mistake this was....
I am using neon in android-ndk,
but I'm facing an problem as topic title.
I download hello-neon demo here :
https://github.com/googlesamples/android-ndk
this is a demo shows how to use neon in android ndk.
and I add this code like this :
#include <arm_neon.h>
uint16_t neonTest(uint8x16_t input){
uint8x16_t minput = vandq_u8(input,input);
uint8x16_t tmp = vpaddq_u8(minput,minput);
tmp = vpaddq_u8(tmp,tmp);
tmp = vpaddq_u8(tmp,tmp);
return vgetq_lane_u16(vreinterpretq_u16_u8(tmp),0);
}
The most strange thing is : both vandq_u8 & vpaddq_u8 are include from arm_neon.h , but the exception trace is :
error: use of undeclared identifier 'vpaddq_u8'
It means 'vandq_u8' is include but 'vpaddq_u8' isn't . but they are in same header file .
How should I resolve this problem?
I believe the issue here is that you are compiling the same code not only for ARM, but also for x86.
The NDK has got a version of arm_neon.h also for x86, which has got an incomplete set of the ARM intrinsics, which emulate them using different SSE intrinsics. This allows using the same SIMD code even for x86, but won't get optimal performance. (Whether this even is desireable, or whether it actually does give you better performance than plain serial code, is highly disputed.) This header does contain vandq_u8, but is lacking vpaddq_u8.
So, make sure to not compile the code containing NEON intrinsics for x86 (remove x86 and x86_64 from ndk.abiFilters in build.gradle). Alternatively, use ifdefs to only use this code when targeting ARM/AArch64, and replace it with a fallback for other architectures.
I have just downloaded MinGW 64 bit for Windows (I'm not quite used to Linux) on http://sourceforge.net/projects/mingw-w64/?source=dlp
When I compile the following code, I get no errors:
#include <iostream>
int main()
{
std::cout << "Code 64 bit :D !" << std::endl;
return 0;
}
Also, when I execute the program in Code::Blocks, eveything works perfectly (using cb_console_runner.exe). The problem occurs when I execute my program outside Code::Blocks. I get the error "The application couldn't start properly (0xc000007b)". By the way, I translated the error from french. Do you have any idea what is the problem or how I can debug this? Oh I forgot: I don't get any errors when code is empty (i.e. when int main(){return0;}).
Thank you!
I've seen this happen here and there when GCC's standard C++ library (libstdc++) (or libgcc as well) is not in your %PATH%. Furthermore, this may also be the case that you have a mismatched version (i.e. a 32 bit version) of the same DLL in your path. Use something like Dependency Walker to determine this.
This doesn't happen when your program is empty since you are not using any symbols from the standard C++ library and thus it is not linked with your application. However when you use std::cout that references a symbol defined in the C++ library and thus it must be linked.
I'm using structure as follows.
struct domain_data
{
int *no_h_domains,
*no_v_domains,
*domain_hsize,
*domain_vsize,
*domain_hstep,
*domain_vstep;
struct domain_pixels
{
int dom_x, dom_y;
double sum,sum2;
int sym;
} ***pixel;
} domain;
But when I try
domain.pixel= (struct domain_pixels ***) malloc(i*sizeof(struct domain_pixels **));
then it gives following errors.
error C2440: '=' : cannot convert from 'domain_pixels ' to 'domain_data::domain_pixels'
and
a value of type "domain_pixels *" cannot be assigned to an entity of type "domain_data::domain_pixels *"
But the same code is executed perfectly fine in win32 application.
Can anyone tell me, whether I can do this in opencl? if yes then how?
The problem is not in the structure of structure, the problem is in the pointers and triple pointers of your struct.
No pointers are allowed to be passed in OpenCL.
Even without that it will never work, since malloc is not allowed in OpenCL.
Please read a guide and a tutorial, before trying to copy-paste a monster C code expecting it to work directly.
It should be doable using OpenCL 2.0 & SVM with Fine-Grain buffers.
Intel is planning to start SVM support with BDW.
When I created another OpenCl project and copied same code over there, then that error is removed ! So thanks everyone for their reply!
extern "C" _declspec(dllexport)void Export3DS(const char* inputname,const char* Objname,const char* mtlname);
I am using vs2008 C++ I need the dll to be output in two mode 32 bit and 64 bit. I am able to compile the code without any error for 32 bit platform but when I switch the platform to x64 bit the error C2065: 'dllexport': undeclared identifier and C2448"_declspec': function-style intializer appears to be a function definition come out. In fact when I switch to x64 platform I didn't make any changes on the code (even a single line of code). Can somebody help me? Thanks in Advance!!!
Try __declspec, with two underscores.