Subsonic 3.0.0.4 Generates Compiler Errors - subsonic3

I am using the latest ActiveRecord template files and have generated my classes. However I am getting this error in my Context1.cs class ...
'SubSonic.Schema.IColumn' does not contain a definition for 'First' and no extension method 'First' accepting a first argument of type 'SubSonic.Schema.IColumn' could be found (are you missing a using directive or an assembly reference?)

Download the latest build from https://github.com/subsonic/SubSonic-3.0

Related

MSBuild not creating DLL's in Bin directory

We are using ADO 2019 on premises and we have a build server where we build everything. I have an ASPNet web page that the developer has add a second project to the SLN for testing.
I am getting the following errors
XYZ.Tests\Properties\PexAssemblyInfo.cs(15,12): Error CS0246: The type or namespace name 'PexAssemblySettingsAttribute' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(15,12): Error CS0246: The type or namespace name 'PexAssemblySettings' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(18,12): Error CS0246: The type or namespace name 'PexAssemblyUnderTestAttribute' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(18,12): Error CS0246: The type or namespace name 'PexAssemblyUnderTest' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(19,12): Error CS0246: The type or namespace name 'PexInstrumentAssemblyAttribute' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(19,12): Error CS0246: The type or namespace name 'PexInstrumentAssembly' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(20,12): Error CS0246: The type or namespace name 'PexInstrumentAssemblyAttribute' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(20,12): Error CS0246: The type or namespace name 'PexInstrumentAssembly' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(21,12): Error CS0246: The type or namespace name 'PexInstrumentAssemblyAttribute' could not be found (are you missing a using directive or an assembly reference?)
XYZ.Tests\Properties\PexAssemblyInfo.cs(21,12): Error CS0246: The type or namespace name 'PexInstrumentAssembly' could not be found (are you missing a using directive or an assembly reference?)
The main Project has the Dll's needed in the Bin Directory, but the second project has no files in the Bin directory.
My MSBuild Arguments are as follows
/p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:PrecompileBeforePublish=true
/p:DeployDefaultTarget=WebPublish
/p:publishUrl="$(build.artifactstagingdirectory)\$(BuildConfiguration)\wwwroot"
/p:OutDir="\Bin\$(BuildConfiguration)"
I have tried to pre-Build the test application using the .csproj, but since it doesn't have an SLN of its own that fails.
All the Nuget Packages are in place in a Packages directory, but I continue to get these errors. I just can't figure out what it wants from where.
After making the new changes, did you try building and testing your project in Visual Studio on your local machine? Did the same error occur?
The error generally is caused by that a type or namespace that is used in the program was not found. You might have forgotten to reference the assembly that contains the type, or you might not have added the required using directive. Or, there might be an issue with the assembly you are trying to reference. For more details, you can see "Compiler Error CS0246".
You can try the following steps in Visual Studio on your local machine to see if the error can be solved:
Correct the name of the namespace. You can use the drop down menu "Intellisense" also known as "Auto-complete".
Fix the custom namespace that was created.
And the following are few ticket for the similar issue as reference.
Getting "type or namespace name could not be found" but everything seems ok?
https://www.codeproject.com/Questions/5277362/Csharp-the-type-or-namespace-name-could-not-be-fou
[UPDATE]
If the DLLs are some of your custom or private references, to use this DLLs when building your project in Azure Pipelines on Azure DevOps, I recommend that you can publish these DLLs as a package to Azure Artifacts. And if you have any code update for the DLLs, you also can build and publish a new version of the package to Azure Artifacts.
After publishing the DLLs as package to Azure Artifacts, when building your project in pipeline, you can use the related task or command to restore the package into the specified path under the source directory of your project for use.
In your case, maybe you can try to publish these DLLs as a NuGet package.

How to export functions and classes from module not using `export` keyword?

I'm investigating an opportunity of using C++ Modules TS in my pet project. One of the important use cases for me is wrapping of legacy headers.
Suppose I have a header file with some functions and classes, std.io.ixx:
int f(int x)
{
return 2 + x;
}
According to this article, I compile the module using the following command:
cl /c /experimental:module /module:name std.io /module:export std.io.ixx
Which gives me a new file std.io.ifc. Then I use this module in another source file, main.cxx:
import std.io;
int main()
{
f(5);
}
Which is compiled with the following command:
cl /c /experimental:module main.cxx
The compilation gives me a following error:
main.cxx(5): error C3861: 'f': identifier not found
So, as we can see, the identifiers from the module were not exported. I could fix this by manually adding export keyword before each identifier I want to export, but this is impossible for the use case of wrapping the legacy headers.
What I'm doing wrong? How to export all possible identifiers from a header?
I believe there are two things wrong:
The module name must not start with std.. When I attempted to do that, I got the error
error C3674: could not find standard library module 'std.io'
This error might not appear if you haven't installed the Standard Library Modules component for Visual Studio. I'm not sure about this, though.
In the blog post you linked to, there's this note:
Note that you currently have to include your header in a .cpp file (or rename your header) because of a limitation in our compiler’s file handling.
That indeed appears to be the case because when I tried with the extension ixx, I got the same error as you.
But after fixing both of the above issues, it worked fine.

Error compiling Boost.Log

I am trying to compile the boost log library and I keep getting this error from the dump_avx2.cpp file
error: always_inline function '_mm256_set1_epi32' requires target feature 'sse4.2', but would be inlined into function 'dump_data_avx2' that is compiled without support for 'sse4.2'
boost/boost/libs/log/src/dump_avx2.cpp:71:31: note: expanded from macro 'BOOST_LOG_AUX_MM_CONSTANTS'
const __m256i mm_char_0 = _mm256_set1_epi32(0x30303030);\
^
I get a lot of errors that are very similar to the one above, all of them have the same error message but different locations in the file where they occur, for reference I am on the commit hash 68701167a1020b0b4c47b76e31d3a3da9e2faf3f for the Boost.Log submodule as fetched from the github repo (https://github.com/boostorg/boost)
Does anyone know how I can go about resolving this issue? I am building with a C++14 compiler and this is what I get when I type g++ --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Thanks!
Note I should clarify that in this context it is required that I compile this library separately.
Note There seem to be two related source files dump_ssse3.cpp and the mentioned dump_avx2.cpp file, do I have to compile only one of them? I cannot make out what to do from the Jamfile in the build folder :(
That looks like a bug in clang (LLVM). First, the intrinsic belongs to AVX2, not SSE4.2. Second, the whole dump_avx2.cpp file is compiled with -mavx2, so the required extensions are enabled. You can see the compiler switches in the error message from b2. And no, both dump_ssse3.cpp and dump_avx2.cpp should be compiled. The library does runtime detection of the available instructions in the CPU and selects the proper implementation.

How to silence "whose type uses the anonymous namespace [-Werror]" gcc version 4.8.2

In one of my project's header file, the following line is included in a inline method
typedef boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64< boost::archive::iterators::remove_whitespace<std::string::const_iterator>>, 8, 6> Base64ToBin;
When I compile this with gcc 4.8.2 I'm getting the following error:
error: ‘boost::archive::iterators::remove_whitespace<__gnu_cxx::__normal_iterator > >’ has a field ‘boost::archive::iterators::remove_whitespace<__gnu_cxx::__normal_iterator > >::’ whose type uses the anonymous namespace [-Werror]
I'm really hitting hard but could not resolve this issue, also from the link1 and link2 it looks like it is an issue with lower version of gcc. Can somebody suggests how to silence this warning or get over with that. I'm using -Werror flag compilation.
This looks like a correct warning. Because the code is in a header, it will be included from multiple files but the anonymous namespace is unique for every file. That means the type doesn't have the same definition everywhere.
Solution: move the relevant code to a .cpp file.

c++ build error

I am trying to integrate wwise into a test project. I have a project on windows 7 using ms visual studio 2010 and this is the error I get after I try and add a necassary cpp to the project. i dont get this build error on my machine at home with the same set up, what does it mean?
------ Build started: Project: wwise test, Configuration: Debug Win32 ------
AkFilePackageLUT.cpp
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.h(204): error C2065: 'NULL' : undeclared identifier
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.cpp(117) : see reference to function template instantiation 'const CAkFilePackageLUT::AkFileEntry<T_FILEID> *CAkFilePackageLUT::LookupFile<AkFileID>(T_FILEID,const CAkFilePackageLUT::FileLUT<T_FILEID> *,bool)' being compiled
with
[
T_FILEID=AkFileID
]
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.h(204): error C2065: 'NULL' : undeclared identifier
c:\program files (x86)\audiokinetic\wwise v2012.2.1 build 4427\sdk\samples\soundengine\common\akfilepackagelut.cpp(140) : see reference to function template instantiation 'const CAkFilePackageLUT::AkFileEntry<T_FILEID> *CAkFilePackageLUT::LookupFile<AkUInt64>(T_FILEID,const CAkFilePackageLUT::FileLUT<T_FILEID> *,bool)' being compiled
with
[
T_FILEID=AkUInt64
]
To me it looks on the first glance like you did not specify a template parameter .
Other possible causes:
You are compiling with a debug version of the C runtime, declaring a
Standard C++ Library iterator variable in a for loop, and then
trying to use that iterator variable outside the scope of the for
loop. Compiling Standard C++ Library code with a debug version of
the C runtime implies /Zc:forScope. See Debug Iterator Support for
more information.
You may be calling a function in an SDK header file that is
currently not supported in your build environment.
Omitting necessary include files, especially if you define
VC_EXTRALEAN, WIN32_LEAN_AND_MEAN, or WIN32_EXTRA_LEAN. These
symbols exclude some header files from windows.h and afxv_w32.h to
speed compiles. (Look in windows.h and afxv_w32.h for an up-to-date
description of what's excluded.)
Identifier name is misspelled.
Identifier uses the wrong uppercase and lowercase letters.
Missing closing quote after a string constant.
Improper namespace scope. To resolve ANSI C++ Standard Library
functions and operators, for example, you must specify the std
namespace with the using directive. The following example fails to
compile because the using directive is commented out and cout is
defined in the std namespace
This error message is saying the following:
in <path...>\akfilepackagelut.h there is a definition of a function template. In fact, it is a templated method of a class. Inside that definition, on line 204, the name NULL is used. NULL is defined in header <cstddef> of the C standard library, and normally you can include that definition by including one of a lot of C/C++ headers, because most of them somehow include <cstddef>. However, akfilepackagelut.h seems to include only headers that in the VS2012 installation you are using do not include that definition, so the compiler does not know what NULL means.
The whole rest of the error message is just template error gibberish, telling you that that function template we are talking about has been instantiated twice somewhere in AkFilePackageLUT.cpp, telling you the exact locations and the template parameters and so on.
What can you do?
Well, if you can not modify the source as you say (Why? You have the source) you can't do anything but perhaps file a bug for the project. If you can modify it would be best to #include <cstddef> in akfilepackagelut.h.