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

lensfun: errors related to locale_t type #2390

Closed
LigH-de opened this issue Mar 2, 2023 · 19 comments
Closed

lensfun: errors related to locale_t type #2390

LigH-de opened this issue Mar 2, 2023 · 19 comments

Comments

@LigH-de
Copy link
Contributor

LigH-de commented Mar 2, 2023

Reported to lensfun/lensfun#1998

...
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp: In member function 'lfError lfDatabase::Load(const char*, const char*, size_t)':
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:826:27: error: 'locale_t' was not declared in this scope; did you mean '_locale_t'?
  826 |     auto loc = uselocale((locale_t) 0); // get current local
      |                           ^~~~~~~~
      |                           _locale_t
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:826:16: error: 'uselocale' was not declared in this scope; did you mean 'setlocale'?
  826 |     auto loc = uselocale((locale_t) 0); // get current local
      |                ^~~~~~~~~
      |                setlocale
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:827:27: error: 'LC_NUMERIC_MASK' was not declared in this scope; did you mean 'LC_NUMERIC'?
  827 |     auto nloc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
      |                           ^~~~~~~~~~~~~~~
      |                           LC_NUMERIC
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:827:59: error: expected ')' before numeric constant
  827 |     auto nloc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
      |                          ~                                ^~
      |                                                           )
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:827:17: error: 'newlocale' was not declared in this scope; did you mean 'setlocale'?
  827 |     auto nloc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
      |                 ^~~~~~~~~
      |                 setlocale
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:858:5: error: 'freelocale' was not declared in this scope; did you mean '_free_locale'?
  858 |     freelocale(nloc);
      |     ^~~~~~~~~~
      |     _free_locale
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp: In member function 'lfError lfDatabase::Save(char*&, size_t&) const':
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:901:27: error: 'locale_t' was not declared in this scope; did you mean '_locale_t'?
  901 |     auto loc = uselocale((locale_t) 0); // get current local
      |                           ^~~~~~~~
      |                           _locale_t
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:901:16: error: 'uselocale' was not declared in this scope; did you mean 'setlocale'?
  901 |     auto loc = uselocale((locale_t) 0); // get current local
      |                ^~~~~~~~~
      |                setlocale
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:902:27: error: 'LC_NUMERIC_MASK' was not declared in this scope; did you mean 'LC_NUMERIC'?
  902 |     auto nloc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
      |                           ^~~~~~~~~~~~~~~
      |                           LC_NUMERIC
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:902:59: error: expected ')' before numeric constant
  902 |     auto nloc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
      |                          ~                                ^~
      |                                                           )
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:902:17: error: 'newlocale' was not declared in this scope; did you mean 'setlocale'?
  902 |     auto nloc = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
      |                 ^~~~~~~~~
      |                 setlocale
G:/MABS/build/lensfun-git/libs/lensfun/database.cpp:1144:5: error: 'freelocale' was not declared in this scope; did you mean '_free_locale'?
 1144 |     freelocale(nloc);
      |     ^~~~~~~~~~
      |     _free_locale
...

logs.zip

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 2, 2023

Is anyone able to try ^ this pull request?

@newcapricasean
Copy link

I am having this same problem... I've been trying to resolve it for hours... literally... Help would greatly be appreciated... I'm now running on Fedora 37... Oh, I see a response above... I'm going to look into that, now...

@newcapricasean
Copy link

How would one amend the m-ab-s/media-autobuild_suite script to pass this parameter over to the lensfun build?

build_lensfun() {
build_glib
do_git_checkout https://github.com/lensfun/lensfun.git lensfun_git
cd lensfun_git
export CMAKE_STATIC_LINKER_FLAGS='-lws2_32 -pthread'
do_cmake "-DBUILD_STATIC=on -DCMAKE_INSTALL_DATAROOTDIR=$mingw_w64_x86_64_prefix"
do_make
do_make_install
sed -i.bak 's/-llensfun/-llensfun -lstdc++/' "$PKG_CONFIG_PATH/lensfun.pc"
unset CMAKE_STATIC_LINKER_FLAGS
cd ..
}

Could I just add "-CMAKE_SYSTEM_NAME=Windows" to CMAKE_STATIC_LINKER_FLAGS='-lws2_32 -pthread' ???

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 2, 2023

There is a script build/media-suite_deps.sh with all the URLs to the repositories.

I'm just testing if it works with SOURCE_REPO_LENSFUN=https://github.com/Biswa96/lensfun.git ... please wait ...

@Biswa96
Copy link
Contributor

Biswa96 commented Mar 2, 2023

It will not work because that link will pull the main/master branch from my repository. You can try to add the following line

--- a/build/media-suite_compile.sh
+++ b/build/media-suite_compile.sh
@@ -1856,6 +1856,7 @@ if [[ $ffmpeg != no ]] && enabled liblensfun &&
     grep_or_sed liconv "$MINGW_PREFIX/lib/pkgconfig/glib-2.0.pc" 's;-lintl;& -liconv;g'
     do_patch "https://github.com/m-ab-s/mabs-patches/raw/master/lensfun/0001-CMake-exclude-mingw-w64-from-some-msvc-exclusive-thi.patch" am
     do_patch "https://github.com/m-ab-s/mabs-patches/raw/master/lensfun/0002-CMake-don-t-add-glib2-s-includes-as-SYSTEM-dirs.patch" am
+    do_patch "https://github.com/lensfun/lensfun/pull/1999.patch" am
     grep_or_sed Libs.private libs/lensfun/lensfun.pc.cmake '/Libs:/ a\Libs.private: -lstdc++'
     do_uninstall "bin-video/lensfun" "${_check[@]}"
     CFLAGS+=" -DGLIB_STATIC_COMPILATION" CXXFLAGS+=" -DGLIB_STATIC_COMPILATION" \

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 2, 2023

Ah, will try that then...

@newcapricasean
Copy link

Where in the media-suite_compile.sh file do you add/change that?

@newcapricasean
Copy link

I'm relatively new to this github, compiling, and linux... If your changes to lensfun script become "commit" ... how long before the actual source code is updated with this change?

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 2, 2023

As soon as you can read from Biswa96 that he published it, you can revert your local changes to the suite scripts.

@newcapricasean
Copy link

And, do you have to actually delete the entire media-suite_compile folder, redownload it, and run it from scratch to test it? Alternatively, can you just erase the sandbox folder, or is it enough to just erase the lensfun folder in the sandbox. Thus far, with these proposed changes, I've just been deleting the lensfun folder, and re-running the script.

@newcapricasean
Copy link

Thank you all for helping... I have seriously been trying to resolve this for most of the night, on my own... lol... Was getting close to just giving up...

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 2, 2023

No need to delete anything. Just use the original scripts again.

@newcapricasean
Copy link

Does his proposed fix correct the problem, for you? Did you just change the media-suite_compile.sh with his proposal above? If so, where in the script do you add that, and do you replace something else with it?

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 2, 2023

Yes, I added the patch as described here.
Yes, after this change the compilation passed.

No, you better do not change anything anymore, because @Biswa96 will probably commit it soon, and then you do not need to add this patch anymore.

@newcapricasean
Copy link

Okie dokie... I'll go ahead and call it a day... (I work an overnight job, so my bedtime is coming up.) Hopefully, by the time I wake up, this evening, it'll all be resolved... 8) Thank you all for helping me out... 8)

@newcapricasean
Copy link

Modifying the database.cpp and lens.cpp files, with the suggested changes, resolved the issue for me... Thank you!!!

@LigH-de
Copy link
Contributor Author

LigH-de commented Mar 16, 2023

@1480c1 - would you add the patch until the pull request gets committed in the lensfun project?

@1480c1
Copy link
Member

1480c1 commented Mar 16, 2023

@1480c1 - would you add the patch until the pull request gets committed in the lensfun project?

7ccbc15

@Biswa96
Copy link
Contributor

Biswa96 commented Aug 10, 2023

This has been fixed in upstream lensfun/lensfun@6cb00f4

@LigH-de LigH-de closed this as completed Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants