signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.49k stars 1.4k forks source link

make fails: src/switch_core_db.c:184:2: error: implicit declaration of function 'sqlite3_enable_load_extension' is invalid in C99 [-Werror,-Wimplicit-function-declaration] #1648

Closed MarioG-X closed 2 years ago

MarioG-X commented 2 years ago

Describe the bug Make gets the messages on macOS Monterey during make: src/switch_core_db.c:184:2: error: implicit declaration of function 'sqlite3_enable_load_extension' is invalid in C99 [-Werror,-Wimplicit-function-declaration] sqlite3_enable_load_extension(db, 1); ^ src/switch_core_db.c:185:8: error: implicit declaration of function 'sqlite3_load_extension' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret = sqlite3_load_extension(db, extension, 0, &err); ^ src/switch_core_db.c:185:8: note: did you mean 'sqlite3_auto_extension'? /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sqlite3.h:6828:16: note: 'sqlite3_auto_extension' declared here SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void));

To Reproduce Steps to reproduce the behavior:

  1. DL Master
  2. ./bootstrap.sh
  3. ./configure
  4. make

Expected behavior Make should complete.

Package version or git hash

Note this is number 4 of 4 issues preventing build since December.

MarioG-X commented 2 years ago

Looks related to this which has been fixed: https://github.com/python/cpython/issues/89160

andywolk commented 2 years ago

Please upload a full build log from configure and make

andywolk commented 2 years ago

I will also need your sqlite header files and the version

andywolk commented 2 years ago

Please try this out https://github.com/signalwire/freeswitch/pull/1658

MarioG-X commented 2 years ago

I downloaded master and ran the make, it looks like it got past this but not sure since it ran into the other error. I looked at the master source for your patch and did not see it so I have no idea how it got past this issue. Here is the info you asked for: configure.txt make1.txt

The sqlite is 3.38.5 header files: sqlite3.h.txt sqlite3ext.h.txt

andywolk commented 2 years ago

mod_av does not support the latest ffmpeg

MarioG-X commented 2 years ago

I see homebrew has both ffmpeg 5.0.1 and 4.4.2 installed most likely different prerequisites require different levels. But this error was the last one I had, but make now stops at the the #1560 error which had been before this. So I am puzzled why today this issue is not incurring first.

MarioG-X commented 2 years ago

Whoops, I meant #1560 is where is stops now.

MarioG-X commented 2 years ago

ffmpeg 5 is the standard install for "brew install ffmpeg" now. I updated the wiki page for prerequisites, it now shows how to install ffmpeg 4.

If you have ffmpeg 5 install be sue to uninstall it and ffmpeg 4, then install ffmpeg 4 per the wiki. This issue us resolved.

summer789 commented 4 months ago

@MarioG-X @andywolk I'm having this issue with macOS 13.5.2 (22G91) and Freeswitch Master and Releases Version, how do I fix it? ![Uploading 97612b79-6bd8-4ca8-be34-d0ccd73608b8.jpeg…]()

MarioG-X commented 4 months ago

Don't know if this will help but make sure you are installing ffmpeg@5 NOT ffmpeg@4 from homebrew. Default HB ffmpeg version is now ffmpeg@6, so you need to specify ffmpeg@5. Remove ffmpeg@4 if you have it. After installing ffmpeg@5 run "brew link ffmpeg@5"

Sorry I no longer have access to update wiki so it is out of date until I find a way to make updates easily.

The current prereqs commands are: brew install autoconf automake curl ffmpeg@5 jpeg ldns libpq libsndfile libtiff libtool lua openssl opus pcre pkg-config sofia-sip speex speexdsp sqlite yasm signalwire/homebrew-signalwire/libks signalwire/homebrew-signalwire/signalwire-c signalwire/homebrew-signalwire/spandsp

brew link ffmpeg@5

I just built todays master on macOS 13.6.6 with CLT 15 and it is fine.

summer789 commented 4 months ago

@MarioG-X
I tried it your way, but it still doesn't work

Warning: Already linked: /opt/homebrew/Cellar/ffmpeg@5/5.1.4_6 To relink, run: brew unlink ffmpeg@5 && brew link --force ffmpeg@5

steps 1、 git clone master 2、 ./bootstrap.sh 3、./configure 4、 make

The following error occurs while executing "make":

src/switch_core_db.c:186:8: error: call to undeclared function 'sqlite3_load_extension'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ret = sqlite3_load_extension(db, extension, 0, &err); ^ src/switch_core_db.c:186:8: note: did you mean 'sqlite3_auto_extension'? /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sqlite3.h:6870:16: note: 'sqlite3_auto_extension' declared here SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void));

environment

@andywolk Can you help see how this should be fixed