Hello i tried to compile Assimp with mingw32.
But during compilation multiple errors appeard.
The first was:
C:\Users\MY_NAME\Downloads\assimp-5.0.1\assimp-5.0.1\code\SMD\SMDLoader.cpp:579:12: error: 'strtok_s' was not declared in this scope; did you mean 'strtok_r'?
I found a solution for the this problem,i changed the source code and it worked but i don't found a solution for the second problem.
The second error was:
c:\users\MY_NAME\downloads\assimp-5.0.1\assimp-5.0.1\contrib\zip\src\zip.h:30:15: error: conflicting declaration 'typedef long int ssize_t'
30 | typedef long ssize_t; /* byte count or error */
here is line 30 from zip.h :
typedef long ssize_t; /* byte count or error */
To make it more clear,i decided to show you a block of code.
here is a block of code from line 27 to 31 in zip.h
#ifdef _WIN64
typedef long long ssize_t; /* byte count or error */
#else
typedef long ssize_t; /* byte count or error *
#endif
I'm using mingw32 with gcc (9.2.0)
Can someone explain why the build fail?
As far as I know, this issue is already closed in our current master. Could you please try the latest from Asset-Importer-Lib#github?
Related
When i include uhd/usb_control.hpp in my main.cpp :
#include <uhd/transport/usb_control.hpp>
/* Some other includes */
int main (void)
{
uhd::transport::usb_control::sptr usbSpeed;
usbSpeed = uhd::transport::usb_control::make(handle, 0);
/* `handle` is a `usb_device_handle::vid_pid_pair_t` */
}
I got error from here:
static sptr make(usb_device_handle::sptr handle, const int interface);
Error:
unexpected token struct. Did you forget a ';'
struct: missing tag name
And another strange error in:
usbSpeed = uhd::transport::usb_control::make(handle, 0);
Error:
Cannot convert argument 2 from int to const int
The only implementation that i find for uhd::transport::usb_control::make is uhd/transport/usb_dummy_impl.cpp which only throw an exception.
Environment information:
Compiler: MS Visual Studio 2017
OS: MS Windows 10
C++ Standard: 17
How to fix those errors ? I only what to detect the USRP usb type. For this i read the uhd source code and i find the uhd/transport/usb_control.hpp, But I have encountered those errors.
maybe the cause of this unexpected behavior is related to your included files and a conflict between some of them, as you mentioned in addition of #include <uhd/transport/usb_control.hpp> you have some other includes. i suggest move this include line upper and lower of other includes and test your code again.
wish my suggest be useful.
Sorry, stuck with VS2013 but I don't think that is a problem. The same code compiles correctly on linux. I assume I need to define uint rather than edit 100+ lines of code.
I am getting "error : explicit type is missing ("int" assumed)" on first line of below code
__device__ uint inline get_smid(void)
{
uint ret;
asm("mov.u32 %0, %%smid ;" : "=r"(ret) );
return ret;
}
At the property for the app there is only CUDA => Host => Preprocessor Definitions I put in
WIN32;uint="unsigned int"
This seemed to fix the "assumed int" but now I am getting "error : expected a declaration"
Replacing uint with unsigned int in the source will compile without error. There is a lot of uint and this breaks with the linux build. Is more required besides 'uint="unsigned int"'? Maybe a switch to cause the NVCC to accept the uint and not give an error?
Just discovered a lot of ushort and I am guessing the same problem. Also, looking at the Linux build, the source were compiled with gcc but the link was done with nvcc so there is a difference.
====sample CUDA has ushort====
i must have not set up the include correctly as these variables are probably ok to use.
I gave up trying to define uint or ushort as the sample CUDA programs had
typedef unsigned int uint;
typedef unsigned short ushort;
so I just put those in each cu file that needed it.
I prefer to avoid using typedef preferring using instead but I have stumbled across the situation where I have to use it since the code outputted by thrift (version 0.9.3) uses a typedef. The smallest instance of the error comes in the following code
#include <iostream>
using namespace std;
typedef int64_t long;
typedef int32_t int;
int main() {
cout << "Hello world " << endl;
return 0;
}
The error I get is
test.cpp:4:17: error: 'long type-name' is invalid
typedef int64_t long;
^
test.cpp:4:1: error: typedef requires a name [-Werror,-Wmissing-declarations]
typedef int64_t long;
^~~~~~~~~~~~~~~~~~~~
test.cpp:5:17: error: cannot combine with previous 'type-name' declaration specifier
typedef int32_t int;
^
test.cpp:5:1: error: typedef requires a name [-Werror,-Wmissing-declarations]
typedef int32_t int;
^~~~~~~~~~~~~~~~~~~
4 errors generated.
The output I get from g++ --version is
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
Could someone help with this error?
long is a keyword in c++, so you cannot create a type with name long. See the list.
But the question is with Thrift generated code. I did some experiments with Thrift, and I can reproduce the problem by adding this line to the official tutorial.thrift file:
typedef i64 long
Apparently Thrift won't check whether this is going to compile or not. So you need to make sure your typedef is ok with all possible languages.
It should be
typedef long int64_t;
typedef int int32_t;
Typedefs work like variable declarations, just with typedef in front.
I'm trying to compile NRF driver with MinGW 4.8.2. I'm getting this error:
In file included from
b:/nrfdriver/sdk/nRF51_SDK_8.1.0_b6ed55f/components/device/nrf51.h:119:0,
from b:/nrfdriver/sdk/nRF51_SDK_8.1.0_b6ed55f/components/softdevice/s130/headers/nrf_soc.h:50,
from b:/nrfdriver/pc-ble-driver-0.5.0/driver/inc_override/nrf_soc.h:21,
from b:/nrfdriver/pc-ble-driver-0.5.0/driver/inc_override/app_util_platform.h:26,
from b:/nrfdriver/sdk/nRF51_SDK_8.1.0_b6ed55f/components/drivers_nrf/uart/app_uart.h:27,
from b:\nrfdriver\pc-ble-driver-0.5.0\driver\src\app_uart_pc.c:13:
C:/MinGW/mingw64/lib/gcc/x86_64-w64-mingw32/4.8.2/include/xmmintrin.h:
In function 'void _mm_setcsr(unsigned int)':
b:/nrfdriver/sdk/nRF51_SDK_8.1.0_b6ed55f/components/toolchain/gcc/core_cm0.h:164:21:
error: expected primary-expression before 'volatile' #define __I
volatile /*!< Defines 'read only' permissions */
^ driver\CMakeFiles\s130_nrf51_ble_driver.dir\build.make:297: recipe for
target 'driver/CMakeFiles/s130_nrf51_ble_driver.dir/src/app_uart_pc.c
.obj' failed
Error comes from this line:
#define __I volatile /*!< Defines 'read only' permissions */
How can such a simple #define lead to a compiler error and any idea how I should fix that? (upgrading the compiler is not an option as this version of the driver is supposed to be built with this version of MinGW).
Note that the driver is meant to be built in 32bits and I'm trying to build it targetting 64bits, dunno if that could be the cause of the problem...
What if we also look in the xmmintrin.h header?
/* Set the control register to I. */
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_setcsr (unsigned int __I)
{
__builtin_ia32_ldmxcsr (__I);
}
Ouch, another use of __I.
I am new in using benchmarks and makefiles. I have downloaded Dhrystone benchmark from the below link and I am trying to compile it, but I am facing weird errors. I tried to solve it,but I am unsuccessful. Can someone help me in running the dhrystone benchmark?
Below are the 2 different ways that I tried to compile. But both are giving the same error result :(
Link: http://fossies.org/unix/privat/old/dhrystone-2.1.tar.gz/
compile commands tried:
gcc -g dhry.h dhry_1.c dhry_2.c -o dhrystonex
make all
error:
gcc -O -DTIMES -DHZ=60 dhry_1.c dhry_2.c -o gcc_dry2
dhry_1.c:31:18: warning: conflicting types for built-in function ‘malloc’ [enabled by default]
dhry_1.c:48:17: error: conflicting types for ‘times’
/usr/include/i386-linux-gnu/sys/times.h:49:16: note: previous declaration of ‘times’ was here
dhry_1.c: In function ‘main’:
dhry_1.c:98:3: warning: incompatible implicit declaration of built-in function ‘strcpy’ [enabled by default]
dhry_1.c:124:11: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
make: *** [gcc_dry2] Error 1
Make the following changes. A line with a - before it indicates one you should remove. A line with a + before it indicates one you should add. In total, you will replace two lines (by preceding them with //) and add one new line (a #include):
diff -bup orig/dhry_1.c new/dhry_1.c
--- orig/dhry_1.c 2012-03-30 11:30:41.984107303 -0700
+++ new/dhry_1.c 2012-03-30 11:31:29.256002567 -0700
## -28,7 +28,7 ## char Ch_1_Glob,
int Arr_1_Glob [50];
int Arr_2_Glob [50] [50];
-extern char *malloc ();
+// extern char *malloc ();
Enumeration Func_1 ();
/* forward declaration necessary since Enumeration may not simply be int */
## -45,7 +45,7 ## Enumeration Func_1 ();
#ifdef TIMES
struct tms time_info;
-extern int times ();
+// extern int times ();
/* see library function "times" */
#define Too_Small_Time (2*HZ)
/* Measurements should last at least about 2 seconds */
diff -bup orig/dhry.h new/dhry.h
--- orig/dhry.h 2012-03-30 11:30:41.984107303 -0700
+++ new/dhry.h 2012-03-30 11:31:29.256002567 -0700
## -392,6 +392,7 ##
/* General definitions: */
#include <stdio.h>
+#include <string.h>
/* for strcpy, strcmp */
#define Null 0