You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@apr.apache.org by bu...@apache.org on 2018/11/17 18:49:38 UTC

[Bug 62922] New: Building libaprutil-1 failed

https://bz.apache.org/bugzilla/show_bug.cgi?id=62922

            Bug ID: 62922
           Summary: Building libaprutil-1 failed
           Product: APR
           Version: 1.6.1
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR-util
          Assignee: bugs@apr.apache.org
          Reporter: contact@grandville.net
  Target Milestone: ---

running this command 
cmake --build . --config "MinSizeRel" --target "libaprutil-1"
will produce huge imports errors (LNK2001) with all exported functions located
in the APR library.

As far as I understand, the problem seems to be located in
apr-util\CMakeLists.txt line 236
SET_TARGET_PROPERTIES(libaprutil-1 PROPERTIES COMPILE_DEFINITIONS
"APU_DECLARE_EXPORT;APR_DECLARE_EXPORT;XML_STATIC;WINNT"

By setting pragma APR_DECLARE_EXPORT, all the APR library functions are
declared in apr.h has dllexported, by removing this flag, they become
dllimported functions and that's exactly what we want ?!?

Regards

Arnaud

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 62922] Building libaprutil-1 failed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62922

Arnaud Grandville <co...@grandville.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEEDINFO                    |RESOLVED

--- Comment #3 from Arnaud Grandville <co...@grandville.net> ---
I just update my project and I confirm all configurations build successfully.
thank you for your rapidity

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 62922] Building libaprutil-1 failed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62922

William A. Rowe Jr. <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from William A. Rowe Jr. <wr...@apache.org> ---
I've committed the fix to 1.6.x/1.7.x branches. Please check out from
https://svn.apache.org/repos/asf/apr/apr-util/branches/1.6.x and confirm
this is working for you, and I'll proceed to correct trunk/apr-2.0 which
is even stranger.

In fact, these export flags were toggled on all our loadable dso modules,
which were similarly incorrect.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


[Bug 62922] Building libaprutil-1 failed

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62922

William A. Rowe Jr. <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from William A. Rowe Jr. <wr...@apache.org> ---
I agree, this is a bug. I'm puzzled why I'm not seeing it; after
creating aprutil-1.lib, it proceeds to build the .dll and emits
no errors on Visual Studio 15/17 here.

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.
[ 90%] Linking C shared library libaprutil-1.dll
   Creating library libaprutil-1.lib and object libaprutil-1.exp
[ 90%] Built target libaprutil-1

I'm not sure what build methodology it defaulted to, your post was
too terse. I'm explicitly using nmake files after first building
apr and openssl similarly into the PREFIX dir;

cmake -G "NMake Makefiles" -D CMAKE_BUILD_TYPE=RelWithDebInfo -D
CMAKE_COLOR_MAKEFILE=OFF -D CMAKE_INSTALL_PREFIX=C:\target\httpd -D
APU_HAVE_CRYPTO=1  C:\source\apr-util-1.6.1

This is likely something nmake/cl.exe can resolve which MSBuild
cannot resolve, and I agree with your presumption that the flaw
is the use of APR_DECLARE_EXPORT in place of the correct flag
APR_DECLARE_IMPORT. If you toggle this, is everything resolved?

I'll verify the same fix on NMake/CL.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org