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

Fix build error on Linux due to missing <stdint.h> include #663

Merged
merged 1 commit into from Mar 6, 2021

Conversation

Calinou
Copy link
Contributor

@Calinou Calinou commented Jan 7, 2021

This closes #662.

Note: Only tested on Linux/GCC, not other compilers.

I get another error when continuing the build, but I still get a working q3map2 binary in the install folder:

❯ scons target="q3map2,q3data"
scons: Reading SConscript files ...
reading saved configuration from site.conf
saving updated configuration
emit build rules
emit configuration: config: target=['q3map2', 'q3data', ''] config=['release']
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/tools/quake3/common/quake3-common.vcxproj
10 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/mathlib/mathlib.vcxproj
4 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/l_net/l_net.vcxproj
2 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/ddslib/ddslib.vcxproj
1 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/picomodel/picomodel.vcxproj
23 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/md5lib/md5lib.vcxproj
2 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/tools/quake3/q3map2/q3map2.vcxproj
44 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/tools/quake3/common/quake3-common.vcxproj
10 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/mathlib/mathlib.vcxproj
4 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/l_net/l_net.vcxproj
2 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/ddslib/ddslib.vcxproj
1 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/picomodel/picomodel.vcxproj
23 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/md5lib/md5lib.vcxproj
2 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/tools/urt/tools/quake3/q3map2/q3map2_urt.vcxproj
38 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/mathlib/mathlib.vcxproj
4 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/l_net/l_net.vcxproj
2 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/libs/ddslib/ddslib.vcxproj
1 source files
parse /home/hugo/Documents/Git/TTimo/GtkRadiant/tools/quake3/q3data/q3data.vcxproj
19 source files
scons: done reading SConscript files.
scons: Building targets ...
scons: `install/q3map2' is up to date.
scons: `install/q3map2_urt' is up to date.
scons: `install/q3data' is up to date.
FinishBuild(["finish"], [])
Lookup and bundle the PNG and JPEG libraries
ldd: install/modules/image.so: No such file or directory
ldd failed with error code 1 and output:b''
scons: *** [finish] AssertionError : 
Traceback (most recent call last):
  File "/home/hugo/Documents/Git/TTimo/GtkRadiant/config.py", line 414, in FinishBuild
    module_ldd = subprocess.check_output( ['ldd', '-r', 'install/modules/image.so'] ).decode( 'utf-8' )
  File "/home/hugo/.pyenv/versions/3.9.0/lib/python3.9/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/hugo/.pyenv/versions/3.9.0/lib/python3.9/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ldd', '-r', 'install/modules/image.so']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hugo/.pyenv/versions/3.9.0/lib/python3.9/site-packages/SCons/Action.py", line 1280, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "/home/hugo/Documents/Git/TTimo/GtkRadiant/config.py", line 417, in FinishBuild
    assert( False )
AssertionError
scons: building terminated because of errors.

I suppose it's not related to the original bug report.

@@ -26,6 +26,8 @@
#include <pthread.h>
#endif

#include <stdint.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is only needed for uintptr_t below, then maybe move this inclusion to line 435?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems strange to me to use an #include at the middle of a file.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, true, but this is already what's done here, and given that this file contains arch-specific conditional compilation, it is perhaps not entirely unsurprising.

@TTimo TTimo merged commit ebf1afd into TTimo:master Mar 6, 2021
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

Successfully merging this pull request may close these issues.

Build error on Fedora 33: ‘uintptr_t’ undeclared (first use in this function)
3 participants