namespace pqxx not recognized in my c++ project - c++

I have a project in c++. I have successfully installed pqxx package using vcpkg but still namespace 'pqxx' is not recognized,
#include<pqxx/pqxx> //No errors
using namespace pqxx; //Error, 'name must be a namespace name'

Related

Cannot resolve namespace std in Android Studio

I have a native library for an Android app. When I load the entire C++ project in Android Studio, some errors are thrown by the IDE saying:
cannot resolve namespace std and cannot find any C++ headers.
#include <fstream>
#include <iostream>
#include <map>
using namespace std;
For all of the above code, fstream, iostream, etc is being marked red and shows cannot find. Any workaround to fix the above issue?

IAR Workbench can't find std::string

I'm trying to compile CppUTest as a library on IAR Workbench v6.3.3 for the AVR UC3C0512C on Windows 7 x64 but when I compile it, it says that the std namespace is not defined.
Here is the snippet of code where I get the first error, the file is SimpleString.h:
#if CPPUTEST_USE_STD_CPP_LIB
#include <string>
#include <stdint.h>
SimpleString StringFrom(const std::string& other);
The last line contains the std::string and this brings me 190 errors all related to this. The message is:
Error[Pe276]: name followed by "::" must be a class or namespace name
C:\COM\SRC\cpputest35\include\CppUTest\SimpleString.h 143
I have tried using the line below but it does not help:
using namespace std;
Under Library Configuration I select Normal DLIB, I also tried with Full DLIB but IAR can't see the std library
Any ideas please?
According to the IAR manuals
The std namespace is not used in either standard EC++ or in Extended EC++. If you
have code that refers to symbols in the std namespace, simply define std as nothing;
for example:
#define std // Nothing here

C# namespace not recognized by C++ via COM

I currently have a C# class library as such
namespace Library
{
[ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("aa950e58-7c6e-4818-8fc9-adecbc7a8f14")]
public interface IQuote
{
........
}
}
I then register it using the following
RegAsm.exe C:\MyFile.dll /tlb:MyFile.tlb /codebase
Now the problem in my C++ application is that
#import "c:\\MyFile.tlb" raw_interfaces_only
using namespace Library;
and then I get the message
Error 7 error C2653: 'Library' : is not a class or namespace name
Any suggestions on how to resolve this issue ?
COM itself does not have a concept of namespace (which is language-specific).
RegAsm.exe uses the assembly name as the name of the library statement in the IDL. It does not care which namespace your COMVisible class is in.
By default the C++ compiler imports a type library into a namespace with its name specified by the library statement in the IDL. Use the assembly name as the namespace name (or rename the namespace in the import statement) in your C++ code.
Took 2 hours, to figure this out.
Sample code is here:
#import "path\to\MyLibrary.tlb" // DEFAULT assembly name is namespace
namespace MyNameSpace = MyLibrary; // make alias back to your namespace
MyNameSpace::IMyClass1Ptr obj; // use namespace here
obj.CreateInstance(__uuidof(MyNameSpace::MyClass1)); // access class in my namespace
Hope that helps.

STL namespace problem in Netbeans 6.8 on AIX

I'm trying to use NetBeans 6.8 on an AIX OS for C++ development.
I continue getting an error message for:
using namespace std;
even after adding the includes for the STL via
options -- c/c++ -- code assistance
The error says: "Unable to resolve identifier std"
Is this a bug in the Netbeans 6.8 AIX version? Or am I missing something?
Thanks for any help!
You can easily enough test if there is no std namespace getting included before your using directive by adding in
namespace std
{
}
just before it. If the compiler is now happy then there was no std namespace stuff actually included.

Subsonic 3 Class Generation not working

I have a Website Project in my Visual Studio 2008. I added a Class Library so I can do my Subsonic Class Generation there and reference it via the project. However when I run the class generation it doesn't complete. It does almost nothing. I'll post what gets generated in the ActiveRecord.cs file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using SubSonic.DataProviders;
using SubSonic.Extensions;
using System.Linq.Expressions;
using SubSonic.Schema;
using System.Collections;
using SubSonic;
using SubSonic.Repository;
using System.ComponentModel;
using System.Data.Common;
namespace Test.Data
{
That is all it generated...
What can I be doing wrong?
Probably a connection string error. Or, at least, that's what I got when I had my connection string wrong.
What is displayed in Visual Studio build errors?