Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vs2015 compling error #601

Closed
andyhx opened this issue Oct 7, 2018 · 7 comments
Closed

vs2015 compling error #601

andyhx opened this issue Oct 7, 2018 · 7 comments
Labels

Comments

@andyhx
Copy link

andyhx commented Oct 7, 2018

hi,I am trying to complie the new version of nccn , I used the vs2015 and the vs2015 x64 native tools ,I followed the commands in wiki for vs2017 , the protobuff was builded successfully ,but when compling the nccn part , I met some errors ,the errors are the followings ;
[ 10%] Building CXX object src/CMakeFiles/ncnn.dir/net.cpp.obj net.cpp d:\ubuntu\project\ncnn_ms\ncnn\src\mat.h(287): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data d:\ubuntu\project\ncnn_ms\ncnn\src\mat.h(341): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(235): error C2059: syntax error: '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(235): error C2143: syntax error: missing ';' before '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(235): error C2059: syntax error: ')' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(245): error C2059: syntax error: '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(245): error C2143: syntax error: missing ';' before '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(245): error C2059: syntax error: ')' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(264): error C2059: syntax error: '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(264): error C2143: syntax error: missing ';' before '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(542): warning C4311: 'type cast': pointer truncation from 'const unsigned char *' to 'unsigned long' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(542): warning C4302: 'type cast': truncation from 'const unsigned char *' to 'unsigned long' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(649): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(660): warning C4311: 'type cast': pointer truncation from 'const unsigned char *' to 'unsigned long' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(754): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data ........................................................................................ NMAKE : fatal error U1077: 'C:\PROGRA2\MICROS1.0\VC\bin\amd64\cl.exe' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2' Stop.
what's the problem? thanks in advance!

@leoay
Copy link

leoay commented Oct 8, 2018

同样的问题,在最新的版本。 以前的版本没有

F:\ncnn_m\ncnn\src\net.cpp(235) : error C2059: 语法错误:“{”
F:\ncnn_m\ncnn\src\net.cpp(235) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)
F:\ncnn_m\ncnn\src\net.cpp(235) : error C2143: 语法错误 : 缺少“;”(在“)”的前面)
F:\ncnn_m\ncnn\src\net.cpp(245) : error C2059: 语法错误:“{”
F:\ncnn_m\ncnn\src\net.cpp(245) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)
F:\ncnn_m\ncnn\src\net.cpp(245) : error C2143: 语法错误 : 缺少“;”(在“)”的前面)
F:\ncnn_m\ncnn\src\net.cpp(264) : error C2059: 语法错误:“{”
F:\ncnn_m\ncnn\src\net.cpp(264) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)
F:\ncnn_m\ncnn\src\net.cpp(264) : error C2143: 语法错误 : 缺少“;”(在“)”的前面)
F:\ncnn_m\ncnn\src\net.cpp(291) : error C2059: 语法错误:“{”
F:\ncnn_m\ncnn\src\net.cpp(291) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)
F:\ncnn_m\ncnn\src\net.cpp(291) : error C2143: 语法错误 : 缺少“;”(在“)”的前面)
F:\ncnn_m\ncnn\src\net.cpp(323) : error C2059: 语法错误:“{”
F:\ncnn_m\ncnn\src\net.cpp(323) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)
F:\ncnn_m\ncnn\src\net.cpp(323) : error C2143: 语法错误 : 缺少“;”(在“)”的前面)

@leoay
Copy link

leoay commented Oct 8, 2018

hi,I am trying to complie the new version of nccn , I used the vs2015 and the vs2015 x64 native tools ,I followed the commands in wiki for vs2017 , the protobuff was builded successfully ,but when compling the nccn part , I met some errors ,the errors are the followings ;
[ 10%] Building CXX object src/CMakeFiles/ncnn.dir/net.cpp.obj net.cpp d:\ubuntu\project\ncnn_ms\ncnn\src\mat.h(287): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data d:\ubuntu\project\ncnn_ms\ncnn\src\mat.h(341): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(235): error C2059: syntax error: '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(235): error C2143: syntax error: missing ';' before '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(235): error C2059: syntax error: ')' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(245): error C2059: syntax error: '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(245): error C2143: syntax error: missing ';' before '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(245): error C2059: syntax error: ')' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(264): error C2059: syntax error: '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(264): error C2143: syntax error: missing ';' before '{' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(542): warning C4311: 'type cast': pointer truncation from 'const unsigned char *' to 'unsigned long' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(542): warning C4302: 'type cast': truncation from 'const unsigned char *' to 'unsigned long' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(649): warning C4244: 'return': conversion from '__int64' to 'int', possible loss of data D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(660): warning C4311: 'type cast': pointer truncation from 'const unsigned char *' to 'unsigned long' D:\ubuntu\Project\ncnn_ms\ncnn\src\net.cpp(754): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data ........................................................................................ NMAKE : fatal error U1077: 'C:\PROGRA2\MICROS1.0\VC\bin\amd64\cl.exe' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2' Stop.
what's the problem? thanks in advance!

I just build 20180427 code here https://github.com/Tencent/ncnn/releases, you can try it!

@andyhx
Copy link
Author

andyhx commented Oct 8, 2018

@leoay ,oldder version 20180427 that u referred works ,thanks so much!

@sirius-ai
Copy link

I annotation the line which use mem_sscanf,and unfold mem_sscanf such as below:

// nscan = mem_sscanf(mem, "%256s %256s %d %d", layer_type, layer_name, &bottom_count, &top_count);

{
int _b=0;
int _n = sscanf(mem, "%256s %256s %d %d" "%n", layer_type, layer_name, &bottom_count, &top_count, &_b);
mem+=_b;
nscan = _b>0?_n:0;
}

This fix the problems in my case.

@nihui nihui added the bug label Oct 15, 2018
@nihui
Copy link
Member

nihui commented Oct 15, 2018

confirmed

@nihui
Copy link
Member

nihui commented Oct 16, 2018

fixed in 4e68a29
try the latest code

@andyhx
Copy link
Author

andyhx commented Oct 18, 2018

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants