Errors in linux header files when building a program - linux

Hello i have a problem when i build a program.
I simply type 'make' but i get a lot of errors from headers files.
Like unknown variable types.
For example:
'size_t' undeclared did you mean 'ssize_t' ?
unknown type name '__gnuc_va_list' did you mean '_IO_va_list'?
I tried to reinstall linux headers, I changed variable types (i know is better not to change system files), included header files but nothing
My laptop has been built with ubuntu, maybe i missed some steps after the installation?

Related

Getting a strange error from winnt.h?

I'm trying to write an x2 camera driver for a Hamamatsu camera in Visual Studio 2015. The X2 driver template already has windows.h included as an external dependency, but when trying to include a necessary header file, it throws an error that windows.h is not included (along with 80 or so errors of function calls that therefore don't exist). But when I include windows.h, I think it's causing a double include and is throwing this error:
Severity: Error (active)
Code: none
Description: expected an identifier Project :x2camera
File: c:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\um\winnt.h
Line: 524
I'm really new to working with Visual Studio projects - how can I include windows.h into the file so it can get the functions and declarations it needs without actually including it and causing a double inclusion? Like I said, it's in the "project dependencies" list, and I think it's being included in another file (but I'm having a hard time finding that).
Or is that not even my problem?
Any help is appreciated.
​No idea what the problem was but I somehow managed to get it to compile. I think it needed to be included elsewhere first, then built, then included where it needed to be... which doesn't make sense honestly but maybe it was an error with how the inclusion was functioning.
Either way, my question is now resolved, though the questions that now arise such as "why the heck did this work" are baffling.

Build error: QT Headers before X11

I am using Buildroot to create Rootfs for embedded system
When trying to build QT, I get this build error:
`compiling egl/qegl_qws.cpp
egl/qegl_qws.cpp:1:0: warning: switch -mcpu=cortex-a15 conflicts with -march=armv7-a switch [enabled by default]
/****************************************************************************
^
moc embedded/qsoundqss_qws.h
moc embedded/qcopchannel_qws.h
moc embedded/qdecorationplugin_qws.h
moc embedded/qdirectpainter_qws.h
moc embedded/qwsmanager_qws.h
In file included from /home/hamzah/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/X11/Xlib.h:44:0,
from /home/hamzah/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/eglplatform.h:118,
from /home/hamzah/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/include/EGL/egl.h:36,
from egl/qegl_p.h:66,
from egl/qegl_qws.cpp:46:
../../include/QtCore/../../src/corelib/kernel/qcoreevent.h:70:9: error: expected identifier before numeric constant
None = 0, // invalid event
^
../../include/QtCore/../../src/corelib/kernel/qcoreevent.h:70:9: error: expected '}' before numeric constant
../../include/QtCore/../../src/corelib/kernel/qcoreevent.h:70:9: error: expected unqualified-id before numeric constant`
This is because None is #defined to be 0 in X11 headers which is creating confllict when used as enum member. From internet, I have been advised to put X11 headers AFTER QT headers. I have tried it where I could find but it does not solve the problem. I think I missed some files
I tried to #undef the symbol and #define laters but that produced more errors as expected. Has anyone dealt with this before and could tell me the exact place to make a change, or do I have to go through a crazy amount of files myself to make changes?
Also, if you have any tip to make this task easy, kindly share. I would even love to know name of all X11 header files
Please report your bug to the Buildroot community, either by posting an e-mail to the mailing list, or filing a bug in the project bug tracker. In either case, make sure you include the Buildroot version, as well as your complete Buildroot .config file to reproduce the issue.

Error installing Mininet

I get the following error when I try to install Mininet:
Installing Mininet core
~/mininet ~
cc -DVERSION=\"PYTHONPATH=. bin/mn --version\" mnexec.c -o mnexec
mnexec.c: In function ‘setns’:
mnexec.c:49: error: ‘__NR_setns’ undeclared (first use in this function)
I searched online and found that I could fix the problem by defining the missing system call number appropriately for my 32- or 64-bit kernel.
How do I define the missing system call number for the 32-bit kernel?
I do not know what Mininet is, but I believe your problem may be due to lack of a necessary header file. The error:
mnexec.c: In function ‘setns’: `mnexec.c:49: error: ‘__NR_setns’ undeclared (first use in this function)
Indicates that __NR_setns is not declared in what you are attempting to compile. A little digging shows the possible headers in which it is referenced in Linux. See Linux Cross Reference. A short list of possibilities is:
/usr/include/asm/unistd_32.h
/usr/include/asm/unistd_64.h
/usr/include/bits/syscall.h
/usr/include/valgrind/vki/vki-scnums-x86-linux.h
/usr/include/valgrind/vki/vki-scnums-amd64-linux.h
There are others, but those look the most relevant.

error C1084: Cannot read type library file

I have a windows application including some console and c++ projects.
While building application i am getting below mentioned error:-
error C1084: Cannot read type library file...
Biodentify.Gina.Services.tlb:
Error loading type library/dll
Does anyone know how to solve it?
Is the type library at the right place?
Are your app and the type library both 32bit or 64bit?
Are there any includes in your type library?
If your type library includes another type library, keep in mind that the search path
is the app search path.
One more tricky thing: If a type library has an include, and this included type library is registered, it will be found first.

fatal error C1084: Cannot read type library file: 'Smegui.tlb': Error loading type library/DLL

I am trying to build an old version of an application which consists of VC++ projects that were written in Visual Studio 2003.
My OS is Windows 7 Enterprise (64-bit).
When I try and build the solution I get the following errors:
error C4772: #import referenced a type from a missing type library; '__missing_type__' used as a placeholder
fatal error C1084: Cannot read type library file: 'Smegui.tlb': Error loading type library/DLL.
They both complain about the following import statement:
#import "Smegui.tlb" no_implementation
This is not a case of the file path being incorrect as renaming the Smegui.tlb file causes the compiler to throw another error saying it cannot find the library.
Smegui is from another application that this one depends on. I thought perhaps I was missing a dll but there is no such thing as Smegui.dll.
All I know about .tlb files is that they are a type library and you can create them from an assembly using tlbexp.exe or regasm.exe (the later also registers the assembly with COM)
There is also an Apache Ant build script which uses a custom task to invoke devenv.com to build the projects. This is the same script that the build server originally used to build the application. It gives me the same errors when I try and run it.
The strangest thing about this is that I knew it ought to work seeing as it is all freshly checked out from subversion. I tried many different combinations of admin vs user elevation, VS vs Ant build, cleaning, release.
I have got it to build successfully about 5 times but the build seems to be non-deterministic.
If anyone can shed some light on how this tlb stuff even works or what this error might mean I would greatly appreciate it.
I found a far more reliable solution: open the tlb with oleview.exe and then close it.
Not sure what this actually does but it works every time.
I think oleview is actually one of the samples included with Visual Studio but I haven't had the time to debug it and see what it is doing.
I ran into this error because one type library was trying to load a dependent type library, which it could not find. Even though the dependent type library was in the same directory, and even though that directory was in the searchable path, the compiler would error loading the first type library, but not mention the dependent type library in the error.
To find the pseudo-missing type library, I ran Process Monitor (procman64.exe) during the compile. This showed that after the reported type library had successfully loaded, a dependent type library could not be found. It even showed all of the places that it was looking for the dependent type library, none of which were where it should have been looking (e.g.: ).
The fix was to add a <PreBuildEvent> to the project to copy the dependent .tlb file to one of the directories that was actually being searched.
<PreBuildEvent>
<Command>copy /Y ..\Lib\Interop\CWSpeechRecLib.tlb .\</Command>
</PreBuildEvent>
http://msdn.microsoft.com/en-us/library/sce74ah7%28VS.71%29.aspx
smegui.tlb is referencing some other tlb that the compiler can't find. If you have the .idl for smegui you might be able to figure out what the other is. I suspect the missing tlb is something that original build machine had registered but that your machine doesn't have registered.
A type library is a binary description of a set of interfaces, coclasses and enums. They're usually generated for COM components, in the case of tlbexp and regasm the tlb is created from the assembly metadata. For native COM components they are usually generated from an idl (Interface Description Language) file by the midl tool.
Edit:
I just noticed you're on x64 Windows. Are you building the project with a new version of Visual Studio? If so, are you targeting x86 or x64? If the latter, it may simply be a 32bit component that the compiler can't find (or less likely, a x64 component the x86 compiler can't find if you are targeting x86), for WOW64 the registry is virtualized for x86 vs. x64 applications.
Well I finally found out why I managed to get it to build sometimes and not others... sort of.
So long as I ran the build script with elevated administrator permissions and let that get as far as it could until that error occurred, then run the build script again as a protected administrator succeeded. Those steps must be done in that exact order with no other steps in between. If I try build in Visual Studio it does not work (although I did get it to succeed once). Probably some kind of virtualisation issue although it still doesn't quite make sense.
Well I don't need help on this any more and I know it's probably impossible to fully answer this question without knowing exactly what the build is doing. However if anyone does have any more thoughts I would happily receive them.
Cheers,
Steiny

Resources