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

[FreeBSD] Build failed: libraries/lib-basic-ui/BasicUI.cpp:44:27: error: use of undeclared identifier 'environ' #6328

Closed
VVD opened this issue Apr 22, 2024 · 0 comments · Fixed by #6331
Labels
bug An error, undesired behaviour, or missed functionality

Comments

@VVD
Copy link

VVD commented Apr 22, 2024

Bug description

Build error last release 3.5.0 on FreeBSD 13.3-p1 amd64.

Steps to reproduce

  1. Build from sources

Expected behavior

  1. Build without errors

Actual behavior

Build failed with error:

FAILED: libraries/lib-basic-ui/CMakeFiles/lib-basic-ui.dir/BasicUI.cpp.o
/usr/bin/c++ -DBASIC_UI_API="" -DEXPERIMENTAL_CRASH_REPORT -DEXPERIMENTAL_DRAGGABLE_PLAY_HEAD -DEXPERIMENTAL_FULL_WASAPI -DEXPERIMENTAL_HALF_WAVE -DEXPERIMENTAL_KEY_VIEW -DEXPERIMENTAL_MIDI_OUT -DEXPERIMENTAL_MODULE_PREFS -DEXPERIMENTAL_NOISE_REDUCTION -DEXPERIMENTAL_NOTETRACK_OVERLAY -DEXPERIMENTAL_NYQUIST_SPLIT_CONTROL -DEXPERIMENTAL_PUNCH_AND_ROLL -DEXPERIMENTAL_SCIENCE_FILTERS -DEXPERIMENTAL_SCRUBBING_SCROLL_WHEEL -DEXPERIMENTAL_SCRUBBING_SUPPORT -DEXPERIMENTAL_SPECTRAL_EDITING -DEXPERIMENTAL_SUBRIP_LABEL_FORMATS -DEXPERIMENTAL_THEMING -DEXPERIMENTAL_ZOOM_TOGGLE_BUTTON -DSTRINGS_API="" -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_WX_APP_H_BASE_ -D_WX_BRUSH_H_BASE_ -D_WX_COLOUR_H_BASE_ -D_WX_EVTLOOP_H_ -D_WX_IMAGE_H -D_WX_PEN_H_BASE_ -D__WXGTK__ -Dlib_basic_ui_EXPORTS -DwxUSE_GUI=0 -I/tmp/work/usr/ports/audio/audacity/work/audacity-Audacity-3.5.0/libraries/lib-basic-ui -I/tmp/work/usr/ports/audio/audacity/work/audacity-Audacity-3.5.0/libraries/lib-strings -I/usr/local/lib/wx/include/gtk3-unicode-3.2 -I/usr/local/include/wx-3.2 -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing -O2 -pipe -march=core2 -fstack-protector-strong -fno-strict-aliasing   -DNDEBUG -std=gnu++17 -fPIC -include /tmp/work/usr/ports/audio/audacity/work/.build/src/private/configunix.h -DAUDACITY_VERSION=3 -DAUDACITY_RELEASE=5 -DAUDACITY_REVISION=0 -DAUDACITY_MODLEVEL=0 -DAUDACITY_VERSION_STRING=L\"3.5.0\" -DAUDACITY_FILE_VERSION=L\"3,5,0,0\" -Dsafenew=new -Wno-underaligned-exception-object -Werror=return-type -Werror=dangling-else -Werror=return-stack-address -Werror=defaulted-function-deleted -DWXINTL_NO_GETTEXT_MACRO -U_DEBUG -DIS_RELEASE -pthread -MD -MT libraries/lib-basic-ui/CMakeFiles/lib-basic-ui.dir/BasicUI.cpp.o -MF libraries/lib-basic-ui/CMakeFiles/lib-basic-ui.dir/BasicUI.cpp.o.d -o libraries/lib-basic-ui/CMakeFiles/lib-basic-ui.dir/BasicUI.cpp.o -c /tmp/work/usr/ports/audio/audacity/work/audacity-Audacity-3.5.0/libraries/lib-basic-ui/BasicUI.cpp
/tmp/work/usr/ports/audio/audacity/work/audacity-Audacity-3.5.0/libraries/lib-basic-ui/BasicUI.cpp:44:27: error: use of undeclared identifier 'environ'
   44 |    for(auto envIterator = environ; *envIterator; ++envIterator)
      |                           ^

Audacity Version

other

Operating system

Other

Additional context

Patch:

--- libraries/lib-basic-ui/BasicUI.cpp.orig     2022-09-28 03:57:45 UTC
+++ libraries/lib-basic-ui/BasicUI.cpp
@@ -29,6 +29,10 @@ Paul Licameli
 
 #include <string>
 
+#ifdef __FreeBSD__
+extern char** environ;
+#endif
+
 namespace
 {
 
@VVD VVD added the bug An error, undesired behaviour, or missed functionality label Apr 22, 2024
crsib added a commit to crsib/audacity that referenced this issue Apr 23, 2024
@crsib crsib mentioned this issue Apr 23, 2024
6 tasks
@crsib crsib linked a pull request Apr 23, 2024 that will close this issue
6 tasks
crsib added a commit that referenced this issue Apr 23, 2024
Based on patches provided in #6326, #6327, #6328, #6329
@VVD VVD closed this as completed Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error, undesired behaviour, or missed functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant