473,480 Members | 2,351 Online
Bytes | Software Development & Data Engineering Community
Create 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.dll directive in .EXP
differs from output filename '.\Debug/CIT_OPC_Server.dll'; ignoring
directive
OPCServer.obj : error LNK2001: unresolved external symbol
_CLSID_CITOPCServer

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_CITOPCServer
#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 1182

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

Similar topics

6
2169
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...
1
3643
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...
4
2495
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...
2
8447
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...
0
1184
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...
2
990
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...
3
1908
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...
0
1920
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...
8
1464
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...
0
6911
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7050
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,...
0
6966
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...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4787
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
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...
0
2999
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...
0
1303
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 ...
0
185
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...

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.