473,804 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

precompiled header problems

Hi,

I am working on a dll that exports COM interfaces, and i am having some
troubles with the use of precompiled headers.
the project compiles always, but if i use /Yu (default: use precompiled
header) i get linker error:

OPCServer.exp : warning LNK4070: /OUT:OPCServer.d ll directive in .EXP
differs from output filename '.\Debug/CIT_OPC_Server. dll'; ignoring
directive
OPCServer.obj : error LNK2001: unresolved external symbol
_CLSID_CITOPCSe rver

I can build without problems if i use /Yx (automatically create precompiled
headers) (strange) or
if i don't use precompiled headers at all.

the problem probably lies in the main cpp file:

#define INITGUID // WITHOUT THIS WE WON'T SEE CLSID_CITOPCSer ver
#include "stdafx.h"
#include "_OPCServer _.h"
#include "OPCDEFS.h"
#include "GlobalDef. h"
#include "process.h"
#include "opc10.h"

it looks as if #define INITGUID is not visible anymore by the code that is
_OPCServer_.h, because if i compile without precompiled headers, and i
comment that define away, i get the same linker error.
i have tried switching the lines #define INITGUID and #include "stdafx.h"
but that didn't help.
does anyone know the cause of this strange behavior?

kind regards,
Bruno.

Nov 16 '05 #1
0 1222

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2191
by: Asfand Yar Qazi | last post by:
Hi, Now that GCC 3.4 has precompiled headers, I'm thinking I can stop using pimpls to speed up development time, as it may make life easier (declaring pimpls takes a long time...) What are the views of the experienced users of various C++ implementations? Do precompiled headers allow pimpls to be avoided while maintaining the same speed up of development time?
1
3661
by: JoeS | last post by:
Is there anyway to share a single pch file between projects in VC 7.0? I have 300+ projects each of which creates its own pch. All projects include the exact same header files in the precompiled header. Its takes about 7 seconds to create the precompiled header for each project. That's 35 minutes spent creating precompiled headers for all project! All of the projects use PDB files for debug info. I tried creating Precomp.pch in project...
4
2517
by: Andrew Ward | last post by:
Hi All, I was wondering if it is possible to use precompiled headers without having to include a <stdafx.h> or whatever in every source file. My problem is that I have a project that makes heavy usage of a large third party library which means after pre-processing each translation unit is around 1meg in size. There are reasons though why I cannot use the standard approach to precompiled headers. What I would like to do is somthing like...
2
8474
by: Tommy Vercetti | last post by:
I am working on a Managed C++ project and I get the following error: TestThread.cpp(3) : error C2859: c:\projects\ProjectName\debug\vc70.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header. Why would I get this error? How do I rebuild the precompiled header? Clean Solution, Rebuild Solution, don't help. If I manually delete the vc70.pdb, it doesn't seem to recompile. I've
0
1194
by: citizenkahn | last post by:
I read an article entitled "Sharing precompiled headers between projects" on this group. I am in the same situation as the requesting author, but the solution has not worked for me. Here is my situation, if anyone has a clue as to how I can solve this, please let me know. I am using VS.NET 2003 Arch. I have a solution two projects, a library and an exe. The exe depends upon the library. Both build with /zi in
2
1008
by: Lloyd Dupont | last post by:
I'm using VS.NET 2005 beta 2. I have problem compiling project (it says: 'cannot find file StdAfx.h" which is right in the middle of my project). The 1st time I create a new project and it fixes the problem. Now I have plenty of file I copy the whole project from one computer to an other and I ran into the same problem. Except I can't botyer recreate the projec now... (so many file to transfer.. sigh..), so I change my project properties...
3
1928
by: Kevin Frey | last post by:
I am working on a test migration of our project to Visual Studio 2005 Beta 2 as a precursor to the availability of the full release of VS2005. The most onerous problem so far concerns the requirement by LINK.EXE that if an object file has used precompiled headers, then the resulting "precompiled header object file" must also be one of the objects in the link. (Whilst it does not affect my problem - I would dearly like to know why this...
0
1943
by: simon.hudon | last post by:
Hi everyone, I have a strange problem with precompiled headers with VC8. I have the problem while trying to use a precompiled header to build another precompiled header. I tried the sample code provided on msdn for the use of /Yu /Yc and while it works well with VC++ 7.0, it doesn't with VC++ 8.0 (http://msdn2.microsoft.com/en-us/library/2yzw0wyd.aspx). It gives me this error under VC 8: level2.cpp(3) : fatal error C1083: Cannot...
8
1483
by: Abubakar | last post by:
Hi, I am writing some unmanaged c++ code that would need to be compiled in the future using compilers other than vc++. I'm using the feature of vc++ "use precompiled headers", is there going to be any problem if I compile this code on other compilers? I'm asking this because when I use pch *some* of my cpp files has following as there first line #include "StdAfx.h"
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.