CVI2013: _TARGET_PRODUCT_VERSION_ and _TARGET_FILE_VERSION_ troubles
I've just noticed another strange behaviour of CVI 2013, and it's related with precompiled headers (am I the only user of this feature?).
It's very simple to trigger:
Set up any project for using precompiled headers
Set in Target Settings -> Version Info a version number with auto increment (e.g. 1.0.0.0+) for both file version and product version fields, for the release configuration.
Rebuild the "release" configuration, so to have all files recompiled.
Modify any source that does not trigger precompiled header recompilation
Build the project.
Then the build will terminate with this error messages:
main.c - 2 errors, 2 warnings
1, 1 error: definition of the macro '_TARGET_FILE_VERSION_' conflicts with the definition used to build the precompiled header
1, 1 <built-in>:162:1: note: definition of macro '_TARGET_FILE_VERSION_' in the precompiled header
1, 1 error: definition of the macro '_TARGET_PRODUCT_VERSION_' conflicts with the definition used to build the precompiled header
1, 1 <built-in>:163:1: note: definition of macro '_TARGET_PRODUCT_VERSION_' in the precompiled header
Build failed.
As additional information please note that there is no reference to _TARGET_PRODUCT_VERSION_ and _TARGET_FILE_VERSION_ macros.
The reason is obvious: the precompiled header retains the old values of these variables.
I don't have found any workaround but to stop using the auto-increment feature.
Carlo A.
Megaris
Luis, I hope that my words didn't sound offensive: it wasn't my intention.
No, I don't do the bulk of my development in release configuration.
In my applications, I usually have some "release only" and "debug only" code, selected by conditional compilation by using the NDEBUG / _CVI_DEBUG_ predefined constants.
Sometimes, by chance, it happens I had to do a quick fix in the "release only" code. It isn't a frequent event, anyway.
When this happened on CVI 2013, the compilation ended in a fatal error, on perfectly valid code.
The whole scenario is not exactly common, but it could be misleading to other users, too.
I think I can survive doing only full rebuilds in release configuration: its impact can be made negligible by using a more conventional development pattern.
IMHO all the problems come from the definition itself of the two constants.
Both of them refer to the version of something that should not exist at compilation time, something that in a logical sequence should come to life only when the executable file is generated, or - more precisely - when resource compiler appends to the executable the version information.
Preprocessor constant must obviously be known in the first phase of compilation, so the compiler is somewhat betting on the build result, hoping that all steps involved in executable generation will be successful.
Given this, these constant should not exist at all.
If someone needs to know at run time the actual executable version number, it's not hard get it by using GetFileVersionInfo() API from version.dll. I don't know if there is some equivalent on Linux.
And if someone claims he/she needs to know at compilation time the version number, then he/she is simply doing it wrong...
A sort of compromise could be to exclude from the constants any... variable part, e.g. the autoincrementing numbers. After all, a proper costant must be constant, isn't it ?
I'm very interested to hear your opinion.
Carlo A.
Megaris
Similar Messages
-
CVI 2010 has two new predefined macros: _TARGET_PRODUCT_VERSION_ and _TARGET_FILE_VERSION_
From CVI help:
_TARGET_FILE_VERSION_ is defined as the value in the File Version option of the Version Info dialog box. This macro does not include increment symbols; for example, if the version string in the Version Info dialog box is 1.0.0.0+, this macro is defined to 1.0.0.0.
_TARGET_PRODUCT_VERSION_ is defined as the value in the Product Version option of the Version Info dialog box. This macro does not include increment symbols; for example, if the version string in the Version Info dialog box is 1.0.0.0+, this macro is defined to 1.0.0.0.
LabWindows/CVI auto-increments fields in which you add a + character. For example, if you specify 1.0+.0.0+, the next version string is 1.0.0.0, and LabWindows/CVI increments the version string to 1.1+.0.1+. LabWindows/CVI increments fields only for successful builds of a Release configuration.You can access the File Version and Product Version values programatically using the _TARGET_FILE_VERSION_ and _TARGET_PRODUCT_VERSION_ predefined macros.
I found that these macros don't work, and it's quite easy to reproduce this issue:
in Version Info window specify a file and a product version with auto-increment fields (for example 0.9.0.0+)
every time you rebuild a release configuration you can see that the .exe file version increments as expected (right clicking on the file in Windows Explorer)
but if you use _TARGET_PRODUCT_VERSION_ and/or _TARGET_FILE_VERSION_ macro to show these values on the front panel (calling SetCtrlVal(panel, PANEL_TXT, _TARGET_PRODUCT_VERSION_) you see that this control has the same text in every build. The shown version is the first one entered in the Version Info window, but now in this window the version has the right updated value.
I think this is a bug. Am I right?
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP Embedded
Solved!
Go to Solution.It is exactly how you wrote in your message.
I think that this behavior is the best choice, but I suggest that the documentation for these macros should be modified adding a warning like the following one:
WARNING!
_TARGET_PRODUCT_VERSION_ and _TARGET_FILE_VERSION_ values are updated only when the file that contains them is recompiled.
So be sure to include them only in files that are recompiled at every build.
A better solution would be to have ad additional macro that forces the recompilation of the file that calls it. It would be useful in the files that call _TARGET_PRODUCT_VERSION_ or _TARGET_FILE_VERSION_
Vix
In claris non fit interpretatio
Using LV 2013 SP1 on Win 7 64bit
Using LV 8.2.1 on WinXP SP3
Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
Using CVI 6.0 on Win2k, WinXP and WinXP Embedded -
my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
my iphone4 is 10 times faster
i have backed up on itunes and restored but still no luck
even siri is laggingmy new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
my iphone4 is 10 times faster
i have backed up on itunes and restored but still no luck
even siri is lagging -
i have updated my 4s iphone to ios 6.1.3 and have trouble connecting it to wi fi . i tried to back up it on itunes and then restore it but now i have left with a phone that still doesnt connect to wi fi and lost all my data. anyone knows how to fix it?
If no change after restoring the iPhone with iTunes as a new iPhone or not from the backup, there is a hardware problem.
-
hey all, I have been getting the "cannot get mail" error message on my iphone5 suddenly.
ive been using iphone to check two email accounts for months now, one is gmail and not troubled. the other is mail from thunderbird and i get this error message now saying it is not responding. no settings have been changed or anything, it just suddenly stopped receiving mail on my device as of Tuesday afternoon.
Does anyone have iny ideas about why? i have yet to update to the new OS7 yet, could that be it?'The installer has insufficient privileges to modify this file C:\Program Files (x86)\Common Files\Apple\Apple Application Support\Web kit.resources\inspector\Images\Spinner Inactive Selected.gif.'
That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
XP instructions in the following document: How to perform disk error checking in Windows XP
Vista instructions in the following document: Check your hard disk for errors
Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards? -
Hello. May I ask: I am using Acrobat 6.0.2, and having trouble formatting a PDF created from multiple (jpeg) files. Each page is formatted to A4 size, portrait. But when I create the PDF, each sheet appears as tiny, in the middle of a huge white page. I cannot seem to find any controls to adjust this. Any advice appreciated.
Thanks CtDave, for the further info. Unfortunately, those suggestions are not working, which is strange.
....Until last week, I used to make multi-page PDFs straight from Photoshop: File > Automate > Make PDF. One simply choses the files, orders them, and creates a PDF. (Resolution doesn't matter; 300 DPI is no problem.) However, my new Photoshop CS5 does not have the option in Automate.
What I've done, seeing as Acrobat is letting me down, is use Bridge (new to me) to create the PDF. It worked without a problem, but seems like more work than the old PS method. I will download a newer version of Acrobat to see if that makes any difference.
.....Also, thanks Test Screen Name: I agree with you that jpeg is irrelevant, and that one can make a PDF from Photoshop (Print > Save As - pdf). But that only works for SINGLE PAGE pdf, not multiple pages as far as I can tell.
Kind regards,
Prince Nuada -
I baught second hand iMac and having trouble to reset to factory setting Help pls
I baught second hand iMac and having trouble to reset to factory setting Help pls
The previous owner left a Recovery HD partition on the drive. You cannot use it because it will only install a version of OS X that is tied to that persons Apple ID. You cannot use his/her Apple ID nor reinstall his/her copy of OS X. You must start, literally, from scratch.
You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mavericks if your computer meets the requirements.
Snow Leopard General Requirements
1. Mac computer with an Intel processor
2. 1GB of memory
3. 5GB of available disk space
4. DVD drive for installation
5. Some features require a compatible Internet service provider;
fees may apply.
6. Some features require Apple’s iCloud services; fees and
terms apply.
Clean Install of Snow Leopard
Be sure to make a backup first because the following procedure will erase
the drive and everything on it.
1. Boot the computer using the Snow Leopard Installer Disc or the Disc 1 that came
with your computer. Insert the disc into the optical drive and restart the computer.
After the chime press and hold down the "C" key. Release the key when you see
a small spinning gear appear below the dark gray Apple logo.
2. After the installer loads select your language and click on the Continue
button. When the menu bar appears select Disk Utility from the Utilities menu.
After DU loads select the hard drive entry from the left side list (mfgr.'s ID and drive
size.) Click on the Partition tab in the DU main window. Set the number of
partitions to one (1) from the Partitions drop down menu, click on Options button
and select GUID, click on OK, then set the format type to MacOS Extended
(Journaled, if supported), then click on the Apply button.
3. When the formatting has completed quit DU and return to the installer. Proceed
with the OS X installation and follow the directions included with the installer.
4. When the installation has completed your computer will Restart into the Setup
Assistant. Be sure you configure your initial admin account with the exact same
username and password that you used on your old drive. After you finish Setup
Assistant will complete the installation after which you will be running a fresh
install of OS X. You can now begin the update process by opening Software
Update and installing all recommended updates to bring your installation current.
Download and install Mac OS X 10.6.8 Update Combo v1.1. -
I am running Mountain Lion and have trouble installing Adobe Application Manager
I am running Mountain Lion and have trouble installing Adobe Application Manager
Hi,
Do you receive any specific error message when Adobe application manager is being installed?
Thanks -
I am physically disabled and having trouble selecting apps because of the sensitivity of the screen - any suggestions on what to do?
I would think assistive touch would be exactly what you are looking for. It's engaged using the Accessibility method I described above.
Here's the writeup about assistive touch from the iPad User Guide:
AssistiveTouch AssistiveTouch helps you use iPad if you have difficulty touching the screen or pressing the buttons. You can use a compatible adaptive accessory (such as a joystick) together with AssistiveTouch to control iPad. You can also use AssistiveTouch without an accessory to perform gestures that are difficult for you.
Turn on AssistiveTouch: Go to Settings > General > Accessibility > AssistiveTouch. To set Triple-click Home to turn AssistiveTouch on or off, go to Settings > General > Accessibility > Triple-click Home.
Adjust the tracking speed (with accessory attached): Go to Settings > General > Accessibility > AssistiveTouch > Touch speed.
Show or hide the AssistiveTouch menu: Click the secondary button on your accessory.
Hide the menu button (with accessory attached): Go to Settings > General > Accessibility >
AssistiveTouch > Always Show Menu.
Perform a swipe or drag that uses 2, 3, 4, or 5 fingers: Tap the menu button, tap Gestures, and then tap the number of digits needed for the gesture. When the corresponding circles appear on the screen, flick or drag in the direction required by the gesture. When you finish, tap the menu button.
Perform a pinch gesture: Tap the menu button, tap Favorites, and then tap Pinch. When the pinch circles appear, touch anywhere on the screen to move the pinch circles, then drag the pinch circles in or out to perform a pinch gesture. When you finish, tap the menu button.
Create your own gesture: Tap the menu button, tap Favorites, and then tap an empty gesture placeholder. Or, go to Settings > General > Accessibility > AssistiveTouch > Create New Gesture.
Lock or rotate the screen, adjust iPad volume, or simulate shaking iPad: Tap the menu button, then tap Device.
Simulate pressing the Home button: Tap the menu button, then tap Home. Move the menu button: Drag it to any location on the screen.
Exit a menu without performing a gesture: Tap anywhere outside the menu. -
I have a macbook air and have trouble getting images to load on ebay, many blogs
i have a macbook air and have trouble getting images to load on ebay, many blogs and also pinterest. What can I do to improve performence?
this is not normal but try to see the multiples accounts in the mail check if his account is not connected yet
-
Just bought a brand new airport extreme and having trouble with it being recognized. My mac is version 10.5.8. What should I do?
The new AirPort Extreme needs the 6.x version of AirPort Utility, which comes packed in with Lion 10.7.5 or Mountain Lion 10.8.x......or......you can also configure the device using an iPhone or iPad running a recent iOS.
From Apple's Specifications:
Setup and Administration
iPhone, iPad, or iPod touch with iOS 5 or later and AirPort Utility 1.3
Mac with OS X Lion v10.7.5 or later and AirPort Utility 6.3
A few options.....
Borrow another Mac running Lion or Mountain Lion for 10-15 minutes and set it up. The Mac running 10.5.8 will be able to connect to the wireless....but it will not be able to make any changes to the configuration of the Extreme.
Update to Lion or Mountain Lion.....but check first to make sure that your Mac will support the operating system first.
Use....or borrow an iPhone or iPad to set up the Extreme -
Just bought a new Macbook Air (and a new to Mac) and having trouble connecting to home hub. Hub can be found yet when I enter my password, I receive the message "timed out". Can anyone help me?
GGo into your router's page and disable password protection and try connecting again.
-
I can't download the latest update 5.0.1 I've tried several times and it gets to the end of about 70 minutes of downloading and then says the server timed out. Had the ohone for a year and no trouble until now. Please advise what to do. Thanks.
DIsable your antivirus and firewall.
-
Was skiing with a lifeproof on and my phone did not get wet. On the ride back my phone was struggling to send/receive messages and had trouble opening apps. The screen froze and I hit the sleep button; since then, it has not turned on. Any suggestions on what to do?
It probably got too cold and shut down. Warm it to room temperature, then hold the HOME and SLEEP buttons at the same time until an Apple logo appears.
-
I HAVE BOUGHT ITUNES CARD OF $30.00 AND HAVING TROUBLE OF PURCHASING A GAME ON ITUNES
Some Game Apps require a Credit Card assosciated with your Account because of In-App Purchases.
Check with the Developer.
If this is not the issue...
Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact
Maybe you are looking for
-
Sapscript: IF statement over multiple lines ?
Hi, in my sapscript i have to use an IF statement with many OR conditions /: IF cond1 OR cond2 OR cond3 OR cond4 OR cond5 ........ But i can't write it on one line. Even with SHIFT-F8 to go to the right the line lenght is too short. How can i solve
-
Customer open item analysis by balance of overdue items
Hi All, Is there any provision for knowing the customer open items by balance of overdue items in the customer line item display in the t-code FBL5N. The standard process is through the S_ALR_87012178 Regards, Arvind
-
For the past couple of weeks, I've noticed a faint whirring noise in the middle of my pbook. At first I thought it was the fan, but then the fan actually turned on and I could still hear the other noise at the same time. I ignored the noise and figur
-
Safari not renedering graphics (jpegs) correctly
Issue popped up in the past couple of days on my Powerbook 15inch. Not updated or loaded anything in about 4 weeks. Safari is loading/rendering icons and graphics really badly. Everything looks like it is in low resolution. Ironically, the Apple web
-
SQL*Loader loading to Multiple partition.
Hello Gurus, Can some one help me to load data using sqlldr into a partitioned table from a single file. Right now it all goes to default partition. My table is partitioned based on the date column ( quarter wise). how to specify that based on a colu