GithubHelp home page GithubHelp logo

vs2017 build, error about faac HOT 16 CLOSED

knik0 avatar knik0 commented on September 27, 2024
vs2017 build, error

from faac.

Comments (16)

vividos avatar vividos commented on September 27, 2024 1

You're welcome!

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

Should be fixed now.

from faac.

tom-chen-cn avatar tom-chen-cn commented on September 27, 2024

still can't build libfaac project.
errMsg ex:
1>f:\github\faac\libfaac\frame.c(35): error C2065: “PACKAGE_VERSION”: 未声明的标识符
1>f:\github\faac\libfaac\frame.c(35): error C2099: 初始值设定项不是常量
1>f:\github\faac\libfaac\quantize.c(249): error C2088: “-”: 对于 union 非法
1>f:\github\faac\libfaac\quantize.c(249): error C2168: “_mm_max_ps”: 内部函数的实参太少
1>f:\github\faac\libfaac\quantize.c(250): error C2088: “=”: 对于 union 非法
1>f:\github\faac\libfaac\quantize.c(251): error C2088: “
=”: 对于 union 非法
1>f:\github\faac\libfaac\quantize.c(253): error C2088: “+=”: 对于 union 非法
1>f:\github\faac\libfaac\quantize.c(158): error C2099: 初始值设定项不是常量

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

@FoxesChen Any chance to provide these error messages in English?

@vividos Could you have a look, please?

from faac.

tom-chen-cn avatar tom-chen-cn commented on September 27, 2024

1>f:\github\faac\libfaac\frame.c(35): error C2065: “PACKAGE_VERSION”: undeclared identifier
1>f:\github\faac\libfaac\frame.c(35): error C2099: Initial settings are not constants
1>f:\github\faac\libfaac\quantize.c(249): error C2088: “-”: for union illegal
1>f:\github\faac\libfaac\quantize.c(249): error C2168: “_mm_max_ps”: inner function param too little
1>f:\github\faac\libfaac\quantize.c(250): error C2088: “=”: for union illegal
1>f:\github\faac\libfaac\quantize.c(251): error C2088: “=”: for union illegal
1>f:\github\faac\libfaac\quantize.c(253): error C2088: “+=”: for union illegal
1>f:\github\faac\libfaac\quantize.c(158): error C2099: Initial settings are not constants

from faac.

vividos avatar vividos commented on September 27, 2024

I'll take a look in the evening, maybe the visual studio project files are outdated again, or the PACKAGE_VERSION can't be read from the configure.ac file.

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

1>f:\github\faac\libfaac\frame.c(35): error C2065: “PACKAGE_VERSION”: undeclared identifier
1>f:\github\faac\libfaac\frame.c(35): error C2099: Initial settings are not constants

PACKAGE_VERSION is not defined for non-Autoconf builds.

1>f:\github\faac\libfaac\quantize.c(249): error C2088: “-”: for union illegal
1>f:\github\faac\libfaac\quantize.c(249): error C2168: “_mm_max_ps”: inner function param too little
1>f:\github\faac\libfaac\quantize.c(250): error C2088: “=”: for union illegal
1>f:\github\faac\libfaac\quantize.c(251): error C2088: “=”: for union illegal
1>f:\github\faac\libfaac\quantize.c(253): error C2088: “+=”: for union illegal

Seems to be some broken erithmetic with the __m128 data type.

1>f:\github\faac\libfaac\quantize.c(158): error C2099: Initial settings are not constants

There seems to be a logic error in that line. I guess to only compile it with GCC >= 4.6 and not clang it should read

#if !defined(__clang__) && defined(__GNUC__) && (GCC_VERSION >= 40600)

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

Seems to be some broken erithmetic with the __m128 data type.

Reverting parts of this commit might help:
02037bc

from faac.

tom-chen-cn avatar tom-chen-cn commented on September 27, 2024

@vividos you means i install vs tools lost some config, so that vs can't read the config file? because i build project with mingw, success.

from faac.

vividos avatar vividos commented on September 27, 2024

About PACKAGE_VERSION: @knik0 added a tool to faad2 to read the package version from autoconf files and write it to a win32_ver.h:
https://github.com/knik0/faad2/tree/master/utils/win32
faac doesn't have that tool, so it doesn't compile frame.c. I could port over that tool if you want.

Next issue is in input.c:
https://github.com/knik0/faac/blob/master/frontend/input.c#L293
bufi is of type void*, and a value from isize is added to that pointer. MSVC complains because it isn't defined how far the pointer should be advanced; I guess this is a C++ issue (.c files are compiled as C++) and could be fixed by either changing bufi to char* or by forcing MSVC to compile as C.

The remaining issues are in quantize.c, where SSE2 code is used which doesn't compile with MSVC. I guess someone with expertise in SSE2 code on MSVC has to look at this.

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

I could port over that tool if you want.

Yes, please!

either changing bufi to char* or by forcing MSVC to compile as C.

Let's please change the pointer type. So, void pointers are treated like char pointers in pointer arithmetics in C but not in C++?

The remaining issues are in quantize.c, where SSE2 code is used which doesn't compile with MSVC. I guess someone with expertise in SSE2 code on MSVC has to look at this.

I have already found a commit that I could revert in the critical parts and still hopefully achieve the same results.

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

So, void pointers are treated like char pointers in pointer arithmetics in C but not in C++?

Only in GCC:

In GNU C, addition and subtraction operations are supported on pointers to void and on pointers to functions. This is done by treating the size of a void or of a function as 1.

https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Pointer-Arith.html

from faac.

vividos avatar vividos commented on September 27, 2024

I didn't exactly for the C language, but in C++ arithmetic with void* isn't valid.

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

@FoxesChen @vividos Could you please check that the latest commits fixed compilation with MSVC without breaking anything?

from faac.

vividos avatar vividos commented on September 27, 2024

Compiling worked for me now. I'm using Visual Studio 2019, but the conversation when opening a 2017 project is straight-forward (the wizard does everything).
I also encoded a test wav file with faac.exe and an AAC file was produced that seems to be playing correct.

from faac.

fabiangreffrath avatar fabiangreffrath commented on September 27, 2024

Phew, thanks!

from faac.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.